My issue is that when I run this strategy (I created) on a playback connection, the prices that the strategy see's are from the Live chart instead of the playback chart, which is what I am connected to.
To calrify this is only happening with the button I created, to open a limit order (or position).
How can I have the button operation utilize the chart rates instead of the live rates?
The button works fine and calls up a function that opens a limit or order, but the price value of Close[0] is not from the chart but its from the actual current Close[0] value.
Here's an example for a user opening a limit order.
1. User clicks on BUY button ==> function openTrade(OP_BUY) is called
The function openTrade(int op) is comprised of the following:
void openTrade(int op){ double limitprice=0; limitprice=(op==OP_BUY?Close[0]-TickSize:Close[0]+TickSize); if(StopLoss>0) SetStopLoss("stopLoss"), CalculationMode.Ticks, StopLoss,false); if(TakeProfit>0) SetProfitTarget("takeProfit"), CalculationMode.Ticks, TakeProfit); if(op==OP_BUY) EnterLongLimit(0,true,contractSize,limitprice,"Time[1].ToString("yyyy.MM.dd HH:mm")); if(op==OP_SELL) EnterShortLimit(0,true,contractSize,limitprice,"Time[1].ToString("yyyy.MM.dd HH:mm")); }
Thnx.
Jess
EDIT:
I included a video describing the issue, hope it helps
Comment