How to use dynamic Label in ExecuteMarketOrder?
26 May 2014, 08:23
Hi
Is there any way to use dynamic Label in ExecuteMarketOrder?
I tried something like this but I am getting error message "Crashed in OnTick with NullReferenceException: Object reference not set to an instance of an object."
tradeCount += 1;
string tradeLabel = tradeCount.ToString();
ExecuteMarketOrder(TradeType.Buy, Symbol, Volume, tradeLabel, StopLoss, TakeProfit);

Invalid
26 May 2014, 10:26
RE:
Try smth like this:
[Robot(TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)] public class Sample : Robot { int tradeCount = 0; protected override void OnTick() { tradeCount++; string tradeLabel = tradeCount.ToString(); ExecuteMarketOrder(TradeType.Buy, Symbol, 10000, tradeLabel, StopLoss, TakeProfit); } }curious said:
@Invalid