Possible to code this 3D heatmap in PRT? (Mark Whistler’s Wave PM)
Forums › ProRealTime English forum › ProBuilder support › Possible to code this 3D heatmap in PRT? (Mark Whistler’s Wave PM)
- This topic has 34 replies, 5 voices, and was last updated 4 years ago by AlgoAlex.
Tagged: heatmap
-
-
06/28/2019 at 8:50 AM #101586
I’m going around in circles and I’m convinced that the problem comes from the platform engine for calculating values in a loop.
attached 2 screenshots explaining the phenomenon. The code below is the heatmap indicator that records the value of each indicator for each calculated period. I have voluntarily painted in red a period value to check (the period 200), applying the indicator “wave PM” on the graph with the same period can thus control the values returned by the loop.
We see that nothing matches. The “wave PM” indicator marks extremes beyond the value 0.90, while none of them return this type of extreme value when they are calculated inside the WHILE WEND loop. They are all well below, in orders of magnitude that have nothing to do …
In short, if someone has time to check what I wrote, I’m ready to answer questions 🙂 Thank you!123456789101112131415161718192021222324252627282930313233343536373839404142434445464748// ---startperiod=20 //start period of the loopmaxscale=500 //end period of the loopStep=10 //period step of the loopBandsDeviations=1.25 //bands deviation (WAVE PM)Chars= 100 //period of observation (WAVE PM)// ---psize=pointsizeBandsPeriod=startperiod //first period to test is..startperiodwhile BandsPeriod<=maxscale do// --- wave PM indicator calculationDev = std[BandsPeriod]*BandsDeviationsDev1 = square(Dev / psize)//temp=sqrt(average[chars](dev1))*pointsizetemp=sqrt(summation[chars](dev1)/chars)*psizeif temp<>0 thentemp=dev/tempendifif(temp>0) theniexp=Exp(-2*temp)returnNum= (1-iexp)/(1+iexp)osc= (returnNum)elseiexp=Exp(2*temp)returnNum=(iexp-1)/(1+iexp)osc= (returnNum)endif// -----result=oscr=0if bandsperiod=200 thenr=255endifdrawtext("#result#",barindex,BandsPeriod,dialog,bold,10)coloured(r,0,0)BandsPeriod=max(startperiod,BandsPeriod+Step) //increase indicator period for next loop iterationwendreturn startperiod,maxscale06/28/2019 at 9:51 AM #101592Just made a quick test with a RSI instead of the wave PM code and the results match perfectly.. There must be something wrong in the wave PM code when it is parsed in the loop..
123456789101112131415161718192021222324252627// ---startperiod=20 //start period of the loopmaxscale=500 //end period of the loopStep=10 //period step of the loop// ---BandsPeriod=startperiod //first period to test is..startperiodwhile BandsPeriod<=maxscale do// --- wave PM indicator calculationosc = rsi[bandsperiod]// -----result=oscr=0if bandsperiod=50 thenr=255endifdrawtext("#result#",barindex,BandsPeriod,dialog,bold,10)coloured(r,0,0)BandsPeriod=max(startperiod,BandsPeriod+Step) //increase indicator period for next loop iterationwendreturn startperiod,maxscale06/28/2019 at 10:04 AM #101593For people enjoying color on their charts.. RSI heatmap is working fine.
Colors shade from red (oversold) to green (overbought) from period 20 to 500 on a 1-hour and 5-minutes charts. Not the subject of that topic, but information are valuable IMO. Trend following or mean reversion valuable infos in that heatmap.06/28/2019 at 11:32 AM #101607I posted the RSI heatmap in the library, here: RSI MultiPeriods HeatMap
Now, let’s come back to the original subject.. 😳
07/01/2019 at 8:33 AM #101739To continue my monologue and for the records. The problem is located in the average of the standard deviation realized in the loop. With the AVERAGE statement or a sum of the STD divided by the period amount, the result is the same = wrong values.
I made a report to PRT.
1 user thanked author for this post.
07/01/2019 at 10:26 AM #10174107/04/2019 at 5:11 PM #101983You can make very pretty pictures if you take an average or RSI and Stochastic combined.
1234567891011121314151617181920212223242526272829//PRC_RSI and Stochastic multiperiods HeatMap | indicator//Plot an heatmap of the RSI range of periods//04.07.2019// --- settingsstartperiod=2 //start period of the loopmaxscale=500 //end period of the loopStep=10 //period step of the loop// --- end of settingsiPeriod=startperiod //first period to test is..startperiodwhile iPeriod<=maxscale do// --- indicator calculationosc = (stochastic[iperiod,5] + rsi[iperiod])/2// -----result=oscR = max(0,50+(200-(result-50)*12))G = max(0,50+(200+(result-50)*12))drawtext("■",barindex,iperiod,dialog,bold,18) coloured(min(r,255),min(g,255),0)iPeriod=max(startperiod,iPeriod+Step) //increase indicator period for next loop iterationwendreturn startperiod,maxscale07/04/2019 at 5:29 PM #101985As requested, here is another pretty picture but with only a stochastic.
Stochastic 3D heatmap - color gradient1234567891011121314151617181920212223242526272829303132//PRC_CCI multiperiods HeatMap | indicator//Plot an heatmap of the CCI range of periods//04.07.2019//Nicolas @ www.prorealcode.com//Sharing ProRealTime knowledge// --- settingsstartperiod=14 //start period of the loopmaxscale=500 //end period of the loopStep=10 //period step of the loop// --- end of settingsiPeriod=startperiod //first period to test is..startperiodwhile iPeriod<=maxscale do// --- indicator calculationosc = stochastic[iperiod,3](close)//cci[iperiod]// -----//R = max(0,50-osc)//G = max(0,50+osc)R =max(0,50+(50-(osc-50)*3))G = 100//max(0,50+(50+(osc-50)*3))B = max(0,50+(50+(osc-50)*4))drawtext("■",barindex,iperiod,dialog,bold,18) coloured(min(r,255),min(g,255),min(b,255))iPeriod=max(startperiod,iPeriod+Step) //increase indicator period for next loop iterationwendreturn startperiod,maxscaleWe are now far from the original topic. 😳
Anyway, I had confirmation today that the average of the ATR is the problem (the average take the last calculated data and not the one of the period calculated dynamically in the loop..). Waiting for a fix.
07/04/2019 at 5:50 PM #101987Glad to hear that there is a fix in the pipeline so that you can finish this indicator and add it to the library.
Even if it turns out not to be a useful trading tool at least it will be very colourful which is what we all want in an indicator!
07/04/2019 at 5:54 PM #10198812/14/2019 at 11:49 AM #11486012/16/2019 at 10:09 AM #11495701/01/2020 at 11:50 PM #11570701/02/2020 at 5:20 PM #11578301/02/2020 at 7:29 PM #115796 -
AuthorPosts