[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Q:How to prevent reentry in a Range breakout System?



PureBytes Links

Trading Reference Links

I'm implementing a RangeBreakOut sys. I want to buy/sell at the Range Hi and Lo.
Since I don't know which direction the breakout will be and I want to get in trade ASAP, I coded as following,

	If MarketPosition =0 then begin
		if (ADXOpen2Day > MinADXYes)  then begin
			if MktID<>1 and (value1>value1[1]) and (time < 1100) and (CurrentBar>=FirstBar+1) then begin
				Buy ("1stBuy") 1 contract at Hi30 stop;
				Sell ("1stSell") 1 contract at Lo30 stop;
				MktID=1;
			end;
		end
		else begin...

My problem is : After I was stoploss,says LX("1stbuy"), I don't want to use this "1st..." type entry. 
But the code will still get me in, say SE("1stSell"),even I use flag MtkID. It seems the Sell order is still in queue.
How can I prevent reentry in such case? If I use extra condition to differentiate the Buy/Sell condition, it seems 
a little bit too late    
THKS in advance,
kuoray