In short: In MC12, with optimize order flow on, under my test conditions: stops are no longer sent intrabar. Instead one has to wait until the new bar.
A non-live realtime simulation (any version) will send the stop intrabar, as will a backtest (any version), as will MC11,10,9 etc when live. MC12, live, is aberrant.
This is clearly a major oversight and very dangerous for the end user.... especially as is in no way expected behaviour.
My test scenario involves the following:
Upperband buy entry stop
AND
Lowerband sell entry stop
Explicit statements that should submit exit stops as soon as a position with "entryname" is detected, and that aren't contained within conditions.
In all versions of MC with optimize order flow OFF... the stops are immediately sent upon the entry order being filled.
In all versions of MC BUT NOT MC12 with optimize order flow ON.......... stops are immediately sent upon entry order being filled.
Tests were conducted using Paper trader (once missed exits were seen in live trading) and using either TS or IQfeed to drive the signal.
Code: Select all
inputs:nb(5),entryticks(4),stopticks(2);
vars:upperband(0),lowerband(0),upperband2(0),lowerband2(0),mpi(0),counter(0);
mpi=minmove/pricescale;
upperband=highest(high,nb);
lowerband=lowest(low,nb);
upperband2=upperband-entryticks*mpi;//where we place our entry buy stop
lowerband2=lowerband+entryticks*mpi;//where we place our entry sell stop
i_setplotvalue(1,upperband);
i_setplotvalue(2,lowerband);
if close<upperband2 then
buy ("long entry") next bar at upperband2 stop;
if close>lowerband2 then
sellshort ("short entry") next bar at lowerband2 stop;
sell ("long stop") from entry ("long entry") next bar at upperband2-stopticks*mpi stop;
buytocover ("short stop") from entry ("short entry") next bar at lowerband2+stopticks*mpi stop;
1) It will increase my margin requirements by 50%
2) It presents an excessive risk and represents poor order management (e.g. Am long but am working: 1 stop, 1 target AND a cut and reverse (double sized order) behind the stop!)
I would say this is a mission critical bug for which a patch should be provided or alternatively, MC12 should be put back into beta.
Thanks in advance for your help.
https://www.multicharts.com/pm/public/m ... es/MC-2501