Good morning , still struggling to set this up , could be an age thing !
can some one help me code :
day candle, for longs if close >100 pips above open but less than 150 then but 1 at next bar open
vice Versa for shorts
with stop entry at prior bar open
??
thanks
I think this is what you are asking for, I added an arbitrary limit to be able to test it. I ran it on the Dax futures daily and it returned 100% (27 trades) since 2012, pretty scary equity curve though
PositionSize = 1
BullBar = close > open
BearBar = open > close
TakeProfit = 100
if not onmarket then
StopLoss = open
LatestMove = abs(close - open)
if LatestMove > 100 and LatestMove < 150 then
if BullBar then
buy PositionSize shares at market
set stop loss StopLoss
set target profit TakeProfit
elsif BearBar then
sellshort PositionSize shares at market
set stop loss StopLoss
set target profit TakeProfit
endif
endif
endif
thanks for that, just run it on FX and see what you mean !
It needs to have stop set at just above or below previous bar by say 10 pips. And take profit at same open close range as previous bar that set up trade.
That would trim it I think and enter exit many more trades. is that possible to code ??
William
Certainly is, a simple change to the code I supplied, there are also plenty of code examples on the site that can help you if you need them