Topics
Replies
Spotware
06 Sep 2017, 16:11
Hi hungtonydang,
No this would not work since the problem is that you execute your code considering all open Positions each time. What you need to do is to consider the positions that have the same Symbol as the chart on which the Symbol is running on. Try adding the following condition before modifying your position
if (Symbol.Code == position.SymbolCode)
Best Regards,
cTrader Team
@Spotware
Spotware
06 Sep 2017, 12:45
Dear hungtonydang,
In order to solve this please use the following code instead to get the order's expity time.
var datetime = Time.AddMinutes(45);
This way you will always get an expiry related to the server's time instead of your local system's time
Best Regards,
cTrader Team
@Spotware
Spotware
06 Sep 2017, 12:23
Hi hungtonydang,
If you are running multiple instances of the cBot on different symbols, then you should reconsider your logic, since in the OnBar() function you are altering not only the positions related to the symbol that the cBot is running but all open positions for all symbols. Probably this is the reason of the weird stop losses. You seem to be changing the stop loss of a position based on a Bollinger Band of another symbol.
Can you please check it and let us know?
Best Regards,
cTrader Team
@Spotware
Spotware
06 Sep 2017, 11:19
Dear Trader,
Thanks for posting this request in our forum. You can also consider posting this request as a Job or contact a professional cAlgo Consultant.
Best Regards,
cTrader Team
@Spotware
Spotware
06 Sep 2017, 11:03
Dear hungtonydang,
Thanks for the cBot. Can you please also verify that with "multiple instances" you mean that you run the cBot on different charts at the same time? If this is the case, is it running on charts of the same symbol? Is it possible to provide us with charts that you run the instances as well as exact cBot parameters? We need you to provide us as much information as possible so that we can reproduce you problem.
Best Regards,
cTrader Team
@Spotware
Spotware
06 Sep 2017, 10:21
Dear tradingpaonly,
See the answers to your questions below.
1) Dragging the trendline's start and end points near the top or bottom of a candle, the points will automatically snap to them.
2) The numbers are Distance in time / Distance in pips/ Angle (Degrees)
3) Yes they can. You can do this by right clicking on the line and unchecking Show Angle.
Best Regards,
cTrader Team
@Spotware
Spotware
06 Sep 2017, 09:55
Dear davidp13,
This is not possible. A solution to this would be to initialize the parameter in the OnStart() method as shown below
protected override void OnStart() { SignalFilename = "C:\\Usersxxx\\Signals\\" + Account.Number + ".csv"; }
Let us know if the above solves your problem.
Best Regards,
cTrader Team
@Spotware
Spotware
06 Sep 2017, 09:37
Hi hungtonydang,
Please let us know your timezone and your cBot's time zone. This might explain the time difference you get. You can find the cBot's timezone in the cBots attributes. See the example below
[Robot(TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)] public class HedgingandScalpingAlgo : Robot {
Best Regards,
cTrader Team
@Spotware
Spotware
05 Sep 2017, 09:26
Dear hungtonydang,
Thanks for sending us the cBot. Unfortunately we cannot build it since CD and _lastExecutedOrder are not defined. Can you please send us a cBot that builds successfully so that we do not need to make any assumptions?
Best Regards,
cTrader Team
@Spotware
Spotware
07 Sep 2017, 09:27 ( Updated at: 21 Dec 2023, 09:20 )
Hi ACCM,
You can get a separate window with the information of each symbol, including market depth, by right clicking on in Symbol inside the MarketWatch and selecting "Information". See image below
Best Regards,
cTrader Team
@Spotware