WE NEED HELP TO CODE ,
OIL/NGAS / TIME 9.00 END2.00 @5 MIN OPEN RANGE FOR OIL/GAS
WHEN THE PRICE GO 8 TICK UP OR DOWN AND STAY THERE FOR 2.50 MIN . THEN A BUY AND SELL ORDER PLACE
LOT 2
NO TRADE ON WED DAY TILL 10.35 AM
STOP LOSS 15 TARGET 2
SORRY STOP LOSS 15/ TARGET IS25
WingParticipant
Veteran
On a 5-minute timeframe, you can’t check whether a price stays somewhere for 2.5 min, only in increments of 5 min can you check this.
it was just to make sure the no false breakout, it can be 5 min
thank you for your advise
p.s i took from the book of mark a fisher he was floor trader at nymex
WingParticipant
Veteran
Alright, maybe here is a code you can try. Note that you might need to change “8” to really be 8 ticks.
timech=090500
if dayofweek=3 then
timech=103500
endif
if time=timech then
if close>close[1]+8 then
buy 1 lot at market
endif
if close<close[1]-8 then
sellshort 1 lot at market
endif
endif
if time>=140000 then
sell at market
exitshort at market
endif
set stop loss 15
set target profit 25
Thanks a lot Wing for helping coding GAMMA’s request.
As you said, to adapt the number “8” to be more universal for every instruments, you can multiply it with “ticksize”, like this:
if close>close[1]+8*ticksize then
wing, thank you very much it was great, I will like to add some more on Monday .
HERE IS SOME WAY WE CAN CONTROL THE FALSE BREAOUT
A. HIGH+LOW+CLOSE DIVIDED BY 3
B. HIGH+LOW DIVIDED BY 2
C . A-B=
D. C+ A AND THEN C- A
THIS IS CALLED DAILY PIVOT RANGE/ IF THE PREVIOUS DAY CLOSE WAS ABOVE TODAY DAILY PIVOT RANGE IT BULLISH
IF IT CLOSE BELOW TODAY DAILY PIVOT RANGE THEN IS BEARISH