I have a simple line of code that checks for an exit condition using:
"if marketposition<>0 and date > entrydate(0) then ..."
I had a booboo recently where I had to restart MC intraday and then manually input the position at the broker for the strategy, which meant that the above code read 'entrydate(0)' to be today rather than yesterday. So my exit did not trigger on the day it should have.
Would one of you MC geniuses know of any more reliable way to go about coding this so it continues to read the entry date as yesterday in the event that MC is restarted today?
PS I have several strategies running on the same symbol, so I can't rely on the marketposition at broker to be correct for each strategy (it is correct in aggregate for all strategies)
exit next day code - tips please
Studies that have been contributed to the community by other users. If you’ve got something useful to share, that’s great!
1 post • Page 1 of 1