Wondering if anyone has an answer to this. I've set a bool flag and it doesn't seem to be working. My code is this:
CurrentPrice = Close[0];
if (Low[0] == High[0]- (Bars.Period.Value*TickSize)&& Position.MarketPosition == MarketPosition.Flat && Trade)
EnterLongLimit(0,true,DefaultQuantity, Low[0] - 1 * TickSize, "");
if(FirstTickOfBar && CurrentPrice < Low[1] )
Trade = false;
My strategy is soposed to place a limit order once a rangebar has completed it's range. The order is 1 tick below the completed range bar. The problem is that, left alone, the order will be amended by the condition if not filled by the time the new range bar has completed it's range.
I set a bool flag to the condition and called it "trade". I then set "trade" to false if the CurrentPrice was less than low of the previous bar. 1 tick less than the low[1] is my order price. I figured that once my order price was hit I didn't want the order to amend any more. Unfortunately the flag isn't working and the order continues to amend before I get filled.
Can anyone give me a suggestion as to why this is?
Thanks,
Rick

Comment