Pivot point Supertrend strategy with mutltimeframe
Forums › ProRealTime English forum › ProOrder support › Pivot point Supertrend strategy with mutltimeframe
- This topic has 7 replies, 2 voices, and was last updated 1 year ago by SVK.
-
-
09/06/2023 at 7:33 PM #220460
Hi all,
small question on you knowledgeable guys.
I’m using Nicolas’s PRC Pivot point supertrend indicator and have just noticed small problem with multitimeframe trading system.
15 minute & 1 hour timeframes where strategy is executed on 15 min.
Rule is simple both 15 min & 1 hour PRC PPS must be RED for short condition to be valid.
However PRC PPS (PRC Pivot point supertrend) 15 min executes short trade despite 1 hour PRC PPS is still green.
Please see photo where I have graphed 1 hour PRC PPS and used vertical lines to highlight the issue.
First white vertical line shows where 15min timeframe thinks 1 hour turned RED but in fact 1 hour is still GREEN.
Second white vertical line shows actual 1 hour timeframe turning RED.
Trade was profitable on this occasion but there quite a few which are not profitable.
Would someone know how to correct this ?
Ps. It might have something to do with the way Pivot points are calculated.
Thank you
09/07/2023 at 7:37 AM #22047509/07/2023 at 12:52 PM #22050109/15/2023 at 11:16 AM #221098MultiTimeFrame PivotSuperTrend123456789101112131415161718192021222324252627282930313233343536373839// Definition of code parametersDEFPARAM CumulateOrders = False // Cumulating positions deactivated//1 Hour TF (get the trend of the 3 minute chart)timeframe(10 minutes,updateonclose)//Pivot point supertrendindicator66, ignored, ignored = CALL "PRC_Pivot Point Supertrend"[2, 3, 200, 0, 0, 0](close)c66 = (close > indicator66)Long1hourCond = c66//10 minutes strategy execution timeframetimeframe(2 minutes,updateonclose)//Pivot point supertrendindicator1, ignored, ignored = CALL "PRC_Pivot Point Supertrend"[2, 3, 109, 0, 0, 0](close)c1 = (close[2] > indicator1[2])//EMAsindicator2 = ExponentialAverage[14](close)c2 = (close CROSSES OVER indicator2)CondiLong1 = c1CondiLong2 = Long1hourCondTrigger = c2//longIF not OnMarket and Trigger AND CondiLong1 AND CondiLong2 THENbuy 1 PERPOINT AT MARKETsl = abs(close - indicator1) + 2*pipsizetp = sl * 1SET STOP LOSS slSET TARGET PROFIT tpENDIFgraph Trigger coloured(0,255,127) // GREENgraph CondiLong1 coloured(255,165,0) // ORANGE Supertrend 2 minutesgraph CondiLong2 coloured(220,20,60) // RED Supertrend 10 minutes09/18/2023 at 7:48 AM #221183It seems ok for me.
To make sure you are using the same values in the strategy than the ones displayed on your chart with the indicator, add these lines at the end of your probacktest code:
12graphonprice indicator66graphonprice indicator1It will add the Pivot Point Supertrend of both timeframe into your price chart during backtest.
Also, verify that you are using the same timeframes in the code (10 minutes or 15 minutes?) and also the settings (period, ..) in your backtest and on your chart.1 user thanked author for this post.
09/21/2023 at 9:02 AM #221366Hi Nicolas,
thank you very much for taking look at it.
It must be broken only on my end then.
I have attached a snapshot below where you can see that price on 10 minute chart didn’t go below Supertrend as indicated on 2 minute chart.
2 minute chart GRAPH indicates that Price on 10 minute chart crossed below Supertrend on 20 Sep 2023 15:18 but in fact price on 10 minute chart crossed below Supertrend an 1 hour and 12 minutes later at 16:30.
Graph (red line) on 2 minute shall not dip down any sooner than 16:30.
09/22/2023 at 8:20 AM #221426Are you sure that your Supertrend is set with: 2, 3, 200 settings on your 10-minutes chart?
Could you please add the 2 lines I gave, into the code of your strategy, launch a backtest and post the picture here? We must be sure that the indicators calculation made via CALL in your strategy results in the same ones than indicators applied on chart, thank you.
1 user thanked author for this post.
09/27/2023 at 8:47 AM #221642Hi Nicolas,
10 minute – PRC PPS = 2,3,200
2 minute – PRC PPS = 2,3,91
Please see attached photo as requested.
Looking at 2 minute chart both white lines (PRC PPS) went UNDER the price at 21:00 (26/09/2023) but on 10 minute chart PRC PPS changed folowing day 27/09/2023 at 08:00.
-
AuthorPosts
Find exclusive trading pro-tools on