
Topics
Replies
PanagiotisCharalampous
21 Jun 2018, 11:30
Hi sean.n.long,
Thanks for posting in our forum. Note that trailing stop loss is now offered by cAlgo.API, therefore you do not need to program it yourself anymore. Order functions now feature a trailing stop loss parameter. See below
https://ctdn.com/api/reference/robot/executemarketorder
https://ctdn.com/api/reference/robot/placelimitorder
https://ctdn.com/api/reference/robot/placestoporder
https://ctdn.com/api/reference/robot/placestoplimitorder
Let me know if this helps.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
21 Jun 2018, 09:36
Hi Jared,
Thanks for pointing this out. We are having a look at it. Any change you could share the cBot with us?
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
20 Jun 2018, 11:36
Hi vivo19,
Thanks for letting us know about this. We managed to reproduce it and we will fix it in an upcoming update.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
20 Jun 2018, 09:06
Hi Waxy,
If you can send me the cBot, I will check what is going on.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
19 Jun 2018, 14:23
Hi zedodia,
Implementing such functionality is not in our immediate plans. However, we intend to investigate the possiblitity of offering such features in one of the future versions.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
19 Jun 2018, 14:15
RE:
zedodia said:
Thank you for the clarification. Is there any benefit or pro vs con of running in automate vs trade? Or is it just two options for the same outcome?
Hi zedodia,
There are no significant pros or cons. Whatever is more convenient for you.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
19 Jun 2018, 10:05
Hi sebo1999,
See below an example on how to print the trading sessions of a symbol
using System; using System.Linq; using cAlgo.API; using cAlgo.API.Indicators; using cAlgo.API.Internals; using cAlgo.Indicators; 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() { foreach (var session in Symbol.MarketHours.Sessions) { Print("Session Starts: " + session.StartDay + " " + session.StartTime.ToString()); Print("Session Ends: " + session.EndDay + " " + session.EndTime.ToString()); } } protected override void OnTick() { } protected override void OnStop() { // Put your deinitialization logic here } } }
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
19 Jun 2018, 09:22
Hi leohermoso,
This is not normal behavior. Can you please send troubleshooting information to us. Please press Ctrl+Alt+Shift+T, put the link to this discussion in the text box and press Submit.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
18 Jun 2018, 17:06
Hi zedodia,
cBots should continue working even if you change tabs. You can work with cBots in both applications, as you did when the two applications were separated.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
18 Jun 2018, 16:28
Hi sebo1999,
Could you be more specific on what example do you need? You can get the trading sessions from the Symbol.MarketHours.Sessions property.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
18 Jun 2018, 15:24
Hi swingfish,
I tried it but I did not notice any problem. Positions are considered properly even if direction is reserved. Here is the code I used
using System; using System.Linq; using cAlgo.API; using cAlgo.API.Indicators; using cAlgo.API.Internals; using cAlgo.Indicators; 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() { // Put your initialization logic here } protected override void OnTick() { long VolumeBuy = Positions.Where(x => x.TradeType == TradeType.Buy).Sum(x => -x.Volume); long VolumeSell = Positions.Where(x => x.TradeType == TradeType.Sell).Sum(x => x.Volume); Print("Buy: " + VolumeBuy); Print("Sell: " + VolumeSell); } protected override void OnStop() { // Put your deinitialization logic here } } }
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
18 Jun 2018, 15:13
Hi Astroke,
cTrader accounts need to be linked to a cTID. So to get rid of an account, you should either link it to another email address or delete it. So if you do not wish to have an account anymore, you could also ask your broker to delete your account. But if your account is deleted then you will not be able to relink it or restore it. However it is still at the discretion of the broker to delete/unlink accounts.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
18 Jun 2018, 14:29
( Updated at: 21 Dec 2023, 09:20 )
Hi irmscher9,
I did...
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
18 Jun 2018, 09:37
Hi Patrick,
Here it is.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
15 Jun 2018, 17:12
( Updated at: 21 Dec 2023, 09:20 )
Dear Trader,
Here it is
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
15 Jun 2018, 17:01
Hi Carlos,
Please send me the indicator if possible and rename the cBot to something else. Also make sure that you reference the custom indicator.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
15 Jun 2018, 16:54
Hi Carlos,
WedgeVolume is not an indicator, it is the robot itself. What are you trying to do with the above code?
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
15 Jun 2018, 09:35
Hi Carlos,
See below how to reference an indicator in a cBot
using System; using System.Linq; using cAlgo.API; using cAlgo.API.Indicators; using cAlgo.API.Internals; using cAlgo.Indicators; namespace cAlgo { [Robot(TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)] public class SamplecBotReferenceSMA : Robot { [Parameter("Source")] public DataSeries Source { get; set; } [Parameter("SMA Period", DefaultValue = 14)] public int SmaPeriod { get; set; } private SampleSMA sma; protected override void OnStart() { sma = Indicators.GetIndicator<SampleSMA>(Source, SmaPeriod); } protected override void OnTick() { Print("{0}", sma.Result.LastValue); } } }
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
15 Jun 2018, 09:33
Hi leohermoso,
Please try rounding your TP to one decimal place and let me know if this fixes the error.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
21 Jun 2018, 12:09
Hi Jared,
Please send it at community@spotware.com.
Best Regards,
Panagiotis
@PanagiotisCharalampous