AbzParticipant
Veteran
just wrote a simple strategy and with 2 well known indicators here on the forum PRC_SuperTrend Extended and PRC_Adaptive-ATR-ADX-Trend-V2. However it is not working , maybe i got i wrong?
mySuperTrendExtended1, mySuperTrendExtended2 = CALL "PRC_SuperTrend Extended"[2.236, 66, 1, 10]
myPRCAdaptiveATRADXTrendV2 = CALL "PRC_Adaptive-ATR-ADX-Trend-V2"[21, 3.5, 1.75, 14, 30, 0, 1](close)
// Long entries
if not onmarket and close > mySuperTrendExtended1 and close > mySuperTrendExtended2 and close > myPRCAdaptiveATRADXTrendV2 then
buy 1 SHARES AT MARKET
endif
// exit long
if longonmarket and close < myPRCAdaptiveATRADXTrendV2 then
SELL AT MARKET
endif
//short etntries
if not onmarket and close < mySuperTrendExtended1 and close < mySuperTrendExtended2 and close < myPRCAdaptiveATRADXTrendV2 then
sellshort 1 SHARES AT MARKET
endif
//exit short
if shortonmarket and close > myPRCAdaptiveATRADXTrendV2 then
exitshort at market
endif
Some questions:
- Have you checked that those indicators, with the same settings, on your chart do show any trading signal the way you combined them?
- On which instrument and TF are you backtesting your strategy?
- What does exactly “it is not working” mean?
It appears not to have any syntax error, so it must be some logical errors. Or maybe they are not even errors, simply the way you combined those indicators may not yield any result (see question 1). For instance, if you want to enter a position when two averages show a bullish crossover while macd crosses under the zero line, well… guess what?
Works fine on DJI 4H spread = 4 … see attached
(to avoid confusion (or cause! 🙂 )… the Indicators on my screen shot are not the indicators in the strategy).
Glad to know that GraHal, so it’s much simpler than expected, it’s just a matter of using another instrument and/or another TF.
AbzParticipant
Veteran
I tried on 1 hour gold.
1. I checked my settings inn chart and code and they are the same.
2. It enter the first trade and then never exit.
Grahal if you try 1 hour on gold what results are you getting then ?
Grahal if you try 1 hour on gold what results are you getting then ?
Lawds and lawds of trades, but I’m now bankrupt!! 🙂
Grahal, maye u forgot to turn off the 4 in spread on the Gold pic? or is the strategy so bad u can flip long/short nad make profits? 😛
Hahaha yeah I did forgrt to turn off the spread = 4.
Lower curve is with spread = 1
Upper curve is with full reversal … now I’m getting same as Abz … 1 trade which does not close!
Attached upper curve is with entry strategy (only) reversed.
AbzParticipant
Veteran
strange that it only opens 1 trade , and dont close it….
AbzParticipant
Veteran
on 4 hours chart it opens more trades but on 1 hour chart only 1 that dont close
Check the “myPRCAdaptiveATRADXTrendV2” value by graphing it, I think the problem is that it doesnt compute correctly in probacktest.