So here is a typical example: I enter short, and then pyramid a second level of shares. Then when the level2 exit threshold is reached, I want to close out the second entry, and then finally the level1 exit threshold is reached, I want to close out the very first entry.
EnterShort(1,level1,Instruments[1].MasterInstrument.Name + "_ES_1"); EnterShort(1,level2,Instruments[1].MasterInstrument.Name + "_ES_2"); ... ExitShort(1,level2,Instruments[1].MasterInstrument.Name + "_XS_2",Instruments[1].MasterInstrument.Name + "_ES_2"); ExitShort(1,level1,Instruments[1].MasterInstrument.Name + "_XS_1",Instruments[1].MasterInstrument.Name + "_ES_1");
The problem is, this works sometimes, but not always. Even playing back over the replay data it is different. Sometimes the level2 exit is tied to the level1 entry, and sometimes the level2 exit is tied to the level1 AND level2 entry.

In the attached image, the red line should not be displayed.
Also, I am wondering why the above overloaded exit method requires that a quantity be specified? If I am supplying the entrySignal, shouldn't the method figure out what the quantity is already?
Maybe something like this:
ExitShort(int barsInProgressIndex, string signalName, string fromEntrySignal)
Thanks.

Comment