Hello, this is my first bot ive written.
I tried to keep it as simple as possible, but im sure there are many ways to improve it. It buys lows, near the lows but not after larger drops. Its backtested with 2 pip spread. On the 10 minute time frame.
I can only backtest 100k bars, can someone test 200k for me to see if im wasting my time on this one?
Regards,
Anders
DEFPARAM Preloadbars = 20000
DEFPARAM CumulateOrders = false
DEFPARAM FLATBEFORE =091500
DEFPARAM FLATAFTER =220000
Lo = Lowest[150](close)
Loplus = 15
sl = 180
tp = 180
NoBuyL = Highest[15](high)
adx1 = adx[15]
adxval = 30
n = 1
c1 = adx1 < adxval AND Lo < close AND lo+loplus > close
c3 = nobuyl > close+60
If c1 AND NOT c3 then
buy n share at market
endif
SET STOP loss sl
SET TARGET PROFIT tp
Thanks for that idea. Please find attached the 200k bars backtest result.
I experimented and I don’t like to end up with nothing to show for my time so I did a bit more today … I ended up with attached results using the code below, spread = 4 (Ander’s code but reversed + a few tweaks).
2nd image of stats are with Drawdown populated.
DEFPARAM Preloadbars = 20000
DEFPARAM CumulateOrders = false
DEFPARAM FLATBEFORE =091500
DEFPARAM FLATAFTER =220000
Lo = Lowest[475](close)
Loplus = 15
sl = 50
tp = 70
//NoBuyL = Highest[15](high)
adx1 = adx[15]
adxval = 30
n = 1
c1 = adx1 < adxval AND Lo < close AND lo+loplus > close
//c3 = nobuyl > close+60
If c1 then // AND NOT c3
Sellshort n share at market
endif
SET STOP loss sl
SET TARGET PROFIT tp
Thank you both for replying! 🙂
I will keep working on it, and maybe try reversing the entry
Kind regards,
Anders