Buy and sell zones
Forums › ProRealTime English forum › ProOrder support › Buy and sell zones
- This topic has 9 replies, 2 voices, and was last updated 6 years ago by Real Pro.
-
-
03/28/2018 at 7:37 AM #66599
Hi, I’d like to create a graphical representation for buy/sell zones. I’d like to do this using a support/res code that I made. It’s based on PSAR so that it doesn’t look ahead and can be used for backtesting. The line is shifted 8 bars to the right. If it works maybe I can add it to the library.
Idea is that a close under the line is in the buy zone, or maybe a cross above = buy. Any thoughts how I can improve it? Thanks.
123456789101112131415161718192021//suggested parameters for x,y,z are 1,1,1PSAR = SAR[x,y,z]IF close crosses under PSAR thena = PSARendifIf close crosses over PSAR thenb = PSARendifif close<PSAR thenp = b-(a-b)endifreturn p[8] coloured (0,0,0)//IF close crosses under p then//DRAWARROWup(barindex, low) COLOURED(255,255,255)//ENDIF03/29/2018 at 7:59 AM #6665303/29/2018 at 1:03 PM #66689The plotted line is just the buy zone; haven’t done the sell zone yet. It works a bit like Bollinger bands.
If you add a parameter ‘x’ to this line:
1return p[8] coloured (0,0,0)…you can shift it around and find where it gives the best signals. I like to buy when it crosses back above the line from oversold.
03/29/2018 at 4:09 PM #6670704/01/2018 at 1:39 AM #66886This version adds high volume down bar as a buy condition. Nicolas, would you mind backtesting on more data please? I only have limited data through IG.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657// https://www.prorealcode.com/topic/how-to-highest10volume-but-only-of-down-bars/// Today's volume should be larger than the volume of the highest down day over the last 40 daysDEFPARAM CumulateOrders = False // Cumulating positions deactivatedmaxDay = 40maxDownDay = 0maxDown = 0FOR d = 1 TO maxDay DOr = Close[d] - Open[d]IF r < 0 and Volume[d] > maxDown THENmaxDown = Volume[d]maxDownDay = dENDIFNEXTIF maxDownDay = 0 THENmaxDownDayVol = 0ELSEmaxDownDayVol = Volume[maxDownDay]ENDIFcVol2 = (Volume > maxDownDayVol)// sample screener code////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// Conditions to enter long positionsindicator1 = CALL "SAR supp line"[2, 0.2, 10, 3]c1 = (close < indicator1) //or close<indicator1[1] or close<indicator1[2] or close<indicator1[3]IF c1 and cVol2 THENBUY 5 CONTRACT AT MARKETENDIF// Conditions to exit long positionsindicator2 = CALL "SAR res line"[2, 0.2, 2, 3]c2 = (close >= indicator2)IF c2 THENSELL AT MARKETENDIF// Stops and targets//sET STOP pTRAILING 20 //pLOSS 50 //SET TARGET pPROFIT 1004/03/2018 at 9:00 AM #66998What I am supposed to backtest please? (instrument, timeframe..). I also do not have your indicator on my platform 🙂 (SAR supp line and SAR res line)..
You should add the .itf file in your next post, it will come with the indicators as well.
04/03/2018 at 11:43 AM #6701904/04/2018 at 9:29 AM #6709004/04/2018 at 9:41 AM #67108I moved the topic to automatic trading section. I add your library post at the end of the topic, because I think it would need more refinement before posting it there. Thanks a lot for this indicator and strategy ideas, I still did not have time to test it. Maybe someone will do before me? So n and n-1 are indicators and sys is the strategy.
Did you made backtest on your side already?
04/04/2018 at 11:34 AM #67123So n and n-1 are indicators and sys is the strategy. Did you made backtest on your side already?
Yes.
Yes, but it trades infrequently and I have only the data IG gives me, so the backtest is meaningless on such a tiny dataset (as is WF analysis).
-
AuthorPosts
Find exclusive trading pro-tools on