I'm updating on bar close, and if an MA crossover has occurred then I want to go long or short (and will have to reverse position if not flat). The key is that, in case of reversal, I want reverse the position in the first bar after the crossover (not for example go flat in the bar after the crossover and then in the next bar put on a position in the other direction).
So, as I'm updating on bar close, I think I've realized that I need to give a command to reverse the position.
Does someone have an example of implementing a reverse position command in a NinjaScript strategy? I'm aware of the OIF builder, but the documentation on it is sparse and I'm unsure of the following things for example:
-can I put a reverse command in a NinjaScript or is it only for DLL files, etc.?
-in the OIF reverse command, account and instrument are mandatory, but I would prefer to not have to specify these as is done with for example enterlong()
Thanks in advance for any thoughts...
Jammy
Comment