How do I program this?
Stopbuy at High Outside + 25% * (High of the Outsidecandle -Low of the Outsidecandle)
the stopbuy should only be executed within the next 3 candles
Target Profit = High Outside + 50% * (High of the Outsidecandle – Low of the Outsidecandle)
Stop Loss = Low Outsidecandle
There you go (not tested):
Defparam CumulateOrders = false
Outside1 = high > high[1] and low < low[1]
Outside2 = max(open,close) > max(open[1],close[1])
Outside3 = min(open,close) < min(open[1],close[1])
OutsideBar = Outside1 and Outside2 and Outside3
If OutsideBar then
Entry = high + (range * 0.25)
TP = abs(Entry - (high + (range * 0.50)))
SL = abs(Entry - low)
Endif
If summation[3](OutsideBar) then
Buy 1 contract at Entry STOP
Set Target Profit TP
Set Stop Loss SL
Endif
Maybe one more step back. Maybe you can help me again.
I understand that this part of code, define entry, sl, tp – correct?
If OutsideBar then
Entry = high + (range * 0.25)
TP = abs(Entry - (high + (range * 0.50)))
SL = abs(Entry - low)
Endif
Which part of the code says that the StopBuy is only executed with the next 3 candles? With this one?
If summation[3](OutsideBar) then
Buy 1 contract at Entry STOP
Set Target Profit TP
Set Stop Loss SL
Endif
and if so and I would set n=5, then the StopBuy would only be possible within the next 5 candles – correct?
n = 5
If summation[n](OutsideBar) then
Buy 1 contract at Entry STOP
Set Target Profit TP
Set Stop Loss SL
Endif
Allright?
All of your assumptions are correct.
So fine and a big thank you to you.
The first step of the strategie is done.