Coding Support and Resistance
Forums › ProRealTime English forum › ProOrder support › Coding Support and Resistance
- This topic has 14 replies, 5 voices, and was last updated 4 years ago by Francesco.
-
-
02/28/2020 at 2:15 PM #120757
I asked in the past if it was possible to consider the ProRealTrend automatic detections but seems it’s not.
Considering that, is there a way to code support and resistance in general for the charts? Or at least something similar to these “hot zones” for the prices?
It could be helpful for the development of the strategies, especially for forex.
02/28/2020 at 2:31 PM #120759A Donchian channel can work well for that:
123456//Donchian ChannelUpper = HIGHEST[10](HIGH[1])Lower = LOWEST[10](LOW[1])Middle = (Upper + Lower) / 2c1 = close > Upper//breakout above resistancec2 = close < Lower//breakdown below supportAdjust the number for how many bars to look back
02/28/2020 at 2:47 PM #12076002/28/2020 at 2:57 PM #120761you should start from the beginning
July 8th, 1932 the Dow closed at 41.22 – that’s a pretty safe support level. I’ll start to get worried if we fall below that.
02/28/2020 at 3:03 PM #12076202/28/2020 at 3:19 PM #120763that’s a pretty safe support level
I reckon we may see the DJI around 23,500 as a floor before we start to go back up again?
02/28/2020 at 3:31 PM #120764Yeah could be … there’s a rising trend line at around 24,000, but still, takes a brave man to call it. I’ve got my stoploss at the 1932 low, so I know I’m safe. 😉
(nice bounce at the opening bell today, maybe it’s up from here?)
02/28/2020 at 3:40 PM #120765That recent example is a great start: https://www.prorealcode.com/topic/array-variables-availability-in-prorealtime/#post-118817
Various support and resistance posts:
https://www.prorealcode.com/tag/support-and-resistance/
02/28/2020 at 3:41 PM #120766maybe it’s up from here?)
Most likely a sucker’s rally just like the same price action in the last few days between 2:30 and 3:00 ish? i
02/28/2020 at 5:42 PM #120786First of all, thanks all of you for the contibutions and the participatory spirit. That always remind me how beautiful this community is.
Coming back to the topic, i was talking about something very “dynamic”: the price touches n times a x wide zone (number of touches and width of the zone to be optimized for the specific timeframes of reference). Then the system “knows” that the n times touched and x wide zone is a support/resistance and i can operate on that.
The VERY PROBLEM with this idea is that could be very difficult to coding the spot of the obliques s/r, because of the inability to find a common price touch area.I will read your guys topics and indicators suggestions as soon as possible, maybe i will find something also more interesting than this basic idea 🙂
02/28/2020 at 5:51 PM #12078702/28/2020 at 6:04 PM #12079102/28/2020 at 7:43 PM #12081403/01/2020 at 6:11 PM #120903I think that one was great: https://www.prorealcode.com/prorealtime-indicators/zigzag-supdem-supply-and-demand-zones/
But you’ll have to change the zigzag indicator to something else to be able to use the code in ProOrder. I heard that zigzag would be usable in the future but i’m not sure if it is in the pipe or not.
1 user thanked author for this post.
03/02/2020 at 4:34 PM #120982Here’s a first try on NIKKEI 15M. Not so bad also on robustness test, put it on demo test.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293defparam cumulateorders = falseonce longtrading=1once shorttrading=0// Robustness Testeronce j = 0once flag = 1if flag = 1 thenj = j + 1if j > qty thenflag = -1j = j - 1endifendifif flag = -1 thenj = j - 1if j = 0 thenj = j + randomflag = 1endifendiftradeon = 1if opendate >= 20000101 thenif barindex mod qty = 0 or barindex mod qty = j thentradeon = 1endifendif// General SettingsEMA1 = exponentialaverage[10](close)EMA2 = exponentialaverage[70](close)bullish = close>EMA1 and close>EMA2 and EMA1>EMA2EMA1 = exponentialaverage[10](close)EMA2 = exponentialaverage[70](close)bearish = close<EMA1 and close<EMA2 and EMA1<EMA2// Strategy Settingsf = 10c1=high[f] >= highest[(f)*2+1](high)c2=low[f] <= lowest[(f)*2+1](low)if longtrading then// Longif bullish and tradeon thenif c2 thenbuy 1 contracts at marketendifendifendifif shorttrading then// Shortif bearish and tradeon thenif c1 thensellshort 1 contracts at marketendifendifendif// Stops and Targetsset stop loss 100set target profit 350// BreakevenStartBreakeven = 100PointsToKeep = 25if not onmarket thenBreakevenLevel=0endif// Breakeven Longif longonmarket and close-tradeprice(1)>=startBreakeven*pipsize thenBreakevenLevel = tradeprice(1)+PointsToKeep*pipsizeendifif BreakevenLevel>0 thensell at BreakevenLevel stopendif// Breakeven Shortif shortonmarket and tradeprice(1)-close>startBreakeven*pipsize thenBreakevenLevel = tradeprice(1)-PointsToKeep*pipsizeendifif BreakevenLevel>0 thenexitshort at BreakevenLevel stopendif -
AuthorPosts
Find exclusive trading pro-tools on