Sample:
protected override void OnBarUpdate()
{
if (Position.MarketPosition == MarketPosition.Flat)
if (CrossAbove(SMA(Fast), SMA(Slow), 1))
m_EnterLong=true;
if (CrossBelow(SMA(Fast), SMA(Slow), 1))
m_EnterShort=true;
How can I do this? Assuming I am already in the market in the opposite direction currently:
1. IF I AM CURRENTLY SHORT-If conditions are meet for a Long, before entering the Long, how can I make it exit all current shorts FIRST and then CANCEL any associated orders FIRST BEFORE executing the m_EnterLong=true; in this above code?
Can you please put a sample in so I can test? Vica Versa for IF I AM CURRENTLY LONG.
I have the check market position is Flat above the beginning of the conditions to be sure it always is checking that there is a flat condition after various things happen. Is there a better place to put it?
Thanks a lot!

Greg

Comment