Hi Guys,
I would like to build a simple strategy and test it…I would like to test a moving price average by percentage every 3min to check if the percentage is higher then 0.3%…
If the percentage is high for going UP I will like a BUY position, if is higher for going DOWN I will like a SELL position.
Basically follow the momentum trade.
I attached here my CODE and a print screen and I don’t understand why when I backtested looks I always have gains…also when I change the STOP or LIMIT PROFIT to HIGHER I don’t get any results.
also with more than 3 days of data doesn’t seem to work ..I would like to test this strategy on 1-year data.
Thanks,
Lucian
CODE:
maxPercentage = 0.3
movingPercetange = (close - close[1]) / close * 100
IF movingPercetange >= maxPercentage THEN
IF movingPercetange > 0 THEN
BUY 1 SHARE AT MARKET
ELSE
SELL 1 SHARE AT MARKET
ENDIF
ENDIF
//Stop && Limit
SET STOP LOSS 30
SET TARGET PROFIT 10
with more than 3 days of data doesn’t seem to work
Attached over 1000 Daily bars
I want to backend tested every 3 min. for 1 year at least is that possible using IG and pro real code?
With PRT Premium, a 3 minute chart can load just over 1 year of data (200k units). But if you’re on standard PRT you can only get half that (100k).