Topics
Replies
PanagiotisCharalampous
01 Nov 2018, 13:59
Hi .ics,
Renko bars are available in 3.3. It has been rolled out to some brokers already.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
01 Nov 2018, 12:37
&customvariable=test
No it is just an example
And the request for code doesn't return json but html, we'll have to look for the "code" with the text?
The request for code does not return something. It redirects to Connect site where authentication takes place. After the user authenticates, he is redirected back to your application. The code is in the query string of the redirect request.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
01 Nov 2018, 12:20
Hi swain.sun,
The process goes as follows.
1) Redirect your application to connect site using your credentials
Response.Redirect(_connectUrl + "apps/auth?&client_id=" + _clientId + "&redirect_uri=" + HttpContext.Current.Request.Url.AbsoluteUri + "&customvariable=test&scope=trading");
2) The user will authenticate and then the Connect site with redirect back to your application with a Code in the query string. Read the Code
var code = HttpContext.Current.Request.QueryString["code"];
3) Now that you have the code, you can get the token
var token = AccessToken.GetAccessToken(_connectUrl, code, redirectUri, _clientId, _clientSecret);
Let me know if this helps.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
01 Nov 2018, 12:07
Ηι swain.sun,
I am not sure what the problem is. The function you posted performs a REST request and the token is returned in JSON format. Did you try to run the code?
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
01 Nov 2018, 11:07
Hi Patrick.
The charts should always open attached to cTrader. If they open in a detached state then it is a bug. However, we could not reproduce when this happens. Any assistance in reproducing this problem would be appreciated.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
01 Nov 2018, 10:58
Hi swain.sun,
Maybe you would like to have a look at our sample, to see how the authenitcation process is implemented.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
01 Nov 2018, 10:50
Hi swain.sun,
To get an access token from production environments, you need to use https://connect.spotware.com/ and not https://sandbox-connect.spotware.com/
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
01 Nov 2018, 10:03
Hi swain.sun,
Thank you for posting in our forum. For development purposes, I would suggest to use a demo account on production environments instead of the sandbox.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
01 Nov 2018, 10:01
Hi Nasser,
Thank you for posting in our forum. cTrader supports stock CFDs, you can find some in Spotware cTrader Beta. Also many brokers offer stocks.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
01 Nov 2018, 09:52
Hi kontodospamu5,
You can expose a public method that will update the form's label and call it on tick as below
using System; using System.Linq; using System.Threading; using System.Windows.Forms; using cAlgo.API; using cAlgo.API.Indicators; using cAlgo.API.Internals; using cAlgo.Indicators; namespace cAlgo.Robots { [Robot(TimeZone = TimeZones.UTC, AccessRights = AccessRights.FullAccess)] public class NewcBot : Robot { [Parameter(DefaultValue = 0.0)] public double Parameter { get; set; } private Thread _thread; private Form _f1; protected override void OnStart() { _f1 = new Form(); _thread = new Thread(() => _f1.ShowDialog()); _thread.SetApartmentState(ApartmentState.STA); _thread.Start(); } protected override void OnTick() { _thread = new Thread(() => _f1.UpdateLabel("label")); _thread.SetApartmentState(ApartmentState.STA); _thread.Start(); } protected override void OnStop() { // Put your deinitialization logic here } } }
Let me know if this helps,
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
01 Nov 2018, 09:34
Hi ctid418503,
We will check this and fix it.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
31 Oct 2018, 16:07
Hi
selected is a collection of positions matching your regular expression, first you need to get an item from there and then print the label. See below
using System; using System.Linq; using cAlgo.API; using cAlgo.API.Indicators; using cAlgo.API.Internals; using cAlgo.Indicators; using System.Text.RegularExpressions; namespace cAlgo.Robots { [Robot(TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)] public class NewcBot : Robot { [Parameter(DefaultValue = 0.0)] public double Parameter { get; set; } protected override void OnStart() { ExecuteMarketOrder(TradeType.Buy, Symbol, 1, "Buy", 400, 600); } protected override void OnTick() { var rx = new Regex("\\w+", RegexOptions.IgnoreCase); var selected = from position in Positions where rx.IsMatch(position.Label) select position; Print(selected.First().Label); } protected override void OnStop() { // Put your deinitialization logic here } } }
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
31 Oct 2018, 16:02
Hi Eklon,
Yes, you can find it here.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
31 Oct 2018, 15:56
Hi Elkon,
Thanks. Can you also try on 3.3 and let us know if you experience the same problem?
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
31 Oct 2018, 15:55
Hi swingfish,
We are trying to roll out updates to brokers as soon as they are available. However, this not always possible. Some brokers will be upgraded to 3.3 later on.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
31 Oct 2018, 14:49
Hi irmscher9,
You cannot use regex in Find() method. However, you could consider Linq. See below
var rx = new Regex("your regular expression", RegexOptions.IgnoreCase); var selected = from position in Positions where rx.IsMatch(position.Label) select position;
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
31 Oct 2018, 12:59
Hi tradingu,
Please contact ICMarkets regarding this.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
31 Oct 2018, 12:45
Hi tradingu,
For execution issues, you should contact your broker directly.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
31 Oct 2018, 12:18
( Updated at: 09 Nov 2018, 13:59 )
Hi Peter,
Thanks for bringing this into our attention. We will get in touch with the specific consultant for further clarifications.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
01 Nov 2018, 14:12
Hi Nasser,
Spotware cTrader Beta cannot be used with brokers. Each broker has its own cTrader platform. However, it is not a matter of platform but a matter of what symbols does the broker offer for trading. You will to contact the brokers and find out if they offer stocks or not.
Best Regards,
Panagiotis
@PanagiotisCharalampous