Hi, I’m currently trying to backtest some ideas and I need ProOrder to only deal if stock is above/below ‘x’% on previous days close. For example, I may want to only deal when the stock is over +2% on previous days close. Since theres no timeframe in ProOrder I don’t know how to do this.
Can anybody show me how to code this?
Thanks in advance
Percentage = 10
IF close > (DClose(1) * (1 + (Percentage/100))) THEN
BUY 1 Contract AT Market
ENDIF
IF close < (DClose(1) * (1 - (Percentage/100))) THEN
SELLSHORT 1 Contract AT Market
ENDIF
Is one option which opens a position at the close of the candle if it is your chosen percentage above/below the last candleclose.
Or you can:
Percentage = 10
UpBuyPrice = (DClose(1) * (1 + (Percentage/100)))
DownBuyPrice = (DClose(1) * (1 - (Percentage/100)))
BUY 1 Contract AT UpBuyPrice LIMIT
SELLSHORT 1 Contract AT DownBuyPrice LIMIT
which sets market orders to buy/sell if the chosen increase or decrease is reached.
Thanks a lot, seems to work how I need it 🙂
Sorry – I just noticed a typo.
The LIMIT’s in the second example should be STOP’s as you are setting an inferior price to the current one to buy/sell at.