I understand (some kinds of ?) orders cancel on the next bar unless renewed. I've read many posts and good answers - mostly referring to Samples - CancelOrders etc. which I've also studied.
My strategy - (all working)
All Orders filled, StopLosses working, trailStops working
Unique labelled entries, 3 in each direction with different trailstop levels
All FINE! BUT only when I use: EnterLong() or Short()
Strategy Consists of:
Initialise and OnBarUpdate() method leading into
Condition 1 - EnterLong OR
Condition 2 - EnterShort
ALL FINE!
Change to: EnterLongStop or EnterShortStop
and only Orders where the next bar hits the stop - are filled.
Log shows all other orders CANCELLED.
I dont understand why standard EnterLong and Short Orders stay LIVE - and EnterStop orders do not - by default. Bit odd to me.
I see that I can use long code to keep EnterLongStop live - but it seems to make no difference.
After reviewing your Sample CloseOrders and IORders etc I see your samples have simple conditions contained in one set of brackets. I have some 50 lines of code for each of my two Conditions.
If I am on the right track, I think my dilemma is:
WHERE do I enter all this code for my Conditions 1 & 2
in amongst the CancelOrder coding?
AFTER the OnBarUpdate part? and Before OnOrderUpdate IORder?
After ALL of the IOrder part?
Or somewhere else?
Or am I on the wrong track?
Your assistance much appreciated.
CaptChris
Comment