hi guys, I am a beginner even reading the documentation I have some doubts,
i want to create a pending order as soon as the price broke the previous high line and the stop at the previous low. I don’t know why but it’s not doing what I want, it’s buying but not where I want.
If not longonmarket then
If close >= high[1] then
Buy 1 lot at high[1] stop
If longonmarket and close <= low[1] then
Sell at market
Set target profit range[1]
Endif
Endif
Endif
It should be a LIMIT order and not a STOP order plus some of your other code is incorrect. Try this?
If not longonmarket and close >= high[1] then
Buy 1 lot at high[1] limit
Set target profit range[1]
endif
If longonmarket and close <= low[1] then
Sell at market
Endif
Thanks brother, not abusing but… the method to do the oposit and sell.
Let’s say that I am sellshort, the sell at market will not stop the operation right? Should I buy at market instead?
If you SELLSHORT then to exit the trade you must EXITSHORT.
If you BUY then to exit the trade you must SELL.
If you have a long position open and SELLSHORT then the long position will be closed.
If you have a short position open and BUY then the short position will be closed.
Use two strategies – one for long and one for short if you want to avoid this.