Is it possible to set a moving stop at the level of say low of candle three candles ago less 2 points.
e.g. entry price 6500, low of three candles ago 6420 so stop 6418.
on next bar price 6490 low of 3 bars ago 6645 so stop 6643?
Yes, you can code it this way:
SELL AT Low[3]-2*pipsize STOP
(for a long position).
Hi Thanks for the information. I’d worked something similar out.
Firstly, I’d put the following
BuyPrice = High[1]+2*Pipsize
then the instruction to buy:
BUY 1 SHARES AT BuyPrice STOP
However, I don’t think it works as I’ve been unable to establish how the tester sets the buy price. I have concerns about the tester as I thought reducing the trailing stop would reduce my profits in test mode but they increase e.g. trailing stop on DAX (a volatile market) reducing trail from 10 to 7 increased profit. Even 10 in my view will lead to many stop outs. Is my scepticism unfounded?
What you have coded don’t act as a stoploss, but as a pending buy stop order instead, above the current price. My code refer to a sell stop order to sell the current long position.
Thanks Nicolas,
I think I confused myself trying to solve both my entry point and stop loss. Have you any thoughts about the tester and the apparent anomaly of reducing a tight stop and improving profitability of the strategy?
The profitability of which strategy? 🙂
"SELL" AT Low[3]-2*pipsize STOP
i want to know how to do "sell" become "set STOP LOSS"or"set target profit"
sorry,nicolas my english not well.