lastmanstanding indicator as an histogram
Forums › ProRealTime English forum › ProBuilder support › lastmanstanding indicator as an histogram
- This topic has 9 replies, 4 voices, and was last updated 4 years ago by Patrick K Templar.
Tagged: histogram, lastmanstanding
-
-
02/01/2020 at 6:19 PM #118440
lastmanstanding indicator
Hello
I was hoping that someone could change the last part of the code in Last Man Standing indicator to be a histogram rather than dots plotted on the screen
So that I could use the prorealtime backtesting softwareI have tried but I have failed I was hoping for the Hminor bars and Lminor bars to be plotted as 0.2 – 0.2 and then the Hmajor bar and Lmajor to be plotted as 0.4 -0.4
Thank you
123456789101112131415((atr=averagetruerange[14]if barindex-hhminorbar=PeriodsInMinorSwing thendrawtext(“●”,hhminorbar,hhminorprice,Dialog,Bold,10) coloured(100,149,237)endifif barindex-llminorbar=PeriodsInMinorSwing thendrawtext(“●”,llminorbar,llminorprice/1,Dialog,Bold,10) coloured(100,149,237)endifif barindex-hhmajorbar=PeriodsInMajorSwing thendrawtext(“●”,hhmajorbar,hhmajorprice+atr/2,Dialog,Bold,20) coloured(128,0,128)endifif barindex-llmajorbar=PeriodsInMajorSwing thendrawtext(“●”,llmajorbar,llmajorprice-atr/2,Dialog,Bold,20) coloured(128,0,128)endifreturn EMA coloured(184,134,11) as “EMA”}}02/01/2020 at 6:24 PM #11844202/01/2020 at 7:21 PM #118451>> For clarity of messages on ProRealCode’s forums, please use the “insert code PRT” button to separate the text of the code part! Thank you! << 🙂
02/03/2020 at 12:13 PM #118551Sorry I can’t get it to work and I don’t need the EMA it’s the bar text part that I wish to change so I have Incorporated the full code could you please change it for me I have tried I just keep running into snytex errors
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849//PeriodsInMajorSwing=13//PeriodsInMinorSwing=5//MovingAverageMethod=1//MovingAveragePeriods= 55// --- end of settingsEMA = average[MovingAveragePeriods,MovingAverageMethod](close)hhminorprice=0llminorprice=close*1000for i = 1 to PeriodsInMinorSwing*2 doif high[i]>hhminorprice thenhhminorbar = barindex[i]hhminorprice = high[i]endifif low[i]<llminorprice thenllminorbar=barindex[i]llminorprice=low[i]endifnexthhmajorprice=0llmajorprice=close*1000for i = 1 to PeriodsInMajorSwing*2 doif high[i]>hhmajorprice thenhhmajorbar = barindex[i]hhmajorprice = high[i]endifif low[i]<llmajorprice thenllmajorbar=barindex[i]llmajorprice=low[i]endifnextatr=averagetruerange[14]if barindex-hhminorbar=PeriodsInMinorSwing thendrawtext("●",hhminorbar,hhminorprice,Dialog,Bold,10) coloured(100,149,237)endifif barindex-llminorbar=PeriodsInMinorSwing thendrawtext("●",llminorbar,llminorprice/1,Dialog,Bold,10) coloured(100,149,237)endifif barindex-hhmajorbar=PeriodsInMajorSwing thendrawtext("●",hhmajorbar,hhmajorprice+atr/2,Dialog,Bold,20) coloured(128,0,128)endifif barindex-llmajorbar=PeriodsInMajorSwing thendrawtext("●",llmajorbar,llmajorprice-atr/2,Dialog,Bold,20) coloured(128,0,128)endifreturn EMA coloured(184,134,11) as "EMA"02/03/2020 at 12:50 PM #11855602/03/2020 at 3:14 PM #118580Yes please that would be great if you could thank you
02/03/2020 at 4:26 PM #118585Here is the code that put the lastmanstanding indicator signals into an histogram below the price chart.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960PeriodsInMajorSwing=13PeriodsInMinorSwing=5//https://www.prorealcode.com/topic/lastmanstanding-indicator// --- end of settingshhminorprice=0llminorprice=close*1000for i = 1 to PeriodsInMinorSwing*2 doif high[i]>hhminorprice thenhhminorbar = barindex[i]hhminorprice = high[i]endifif low[i]<llminorprice thenllminorbar=barindex[i]llminorprice=low[i]endifnexthhmajorprice=0llmajorprice=close*1000for i = 1 to PeriodsInMajorSwing*2 doif high[i]>hhmajorprice thenhhmajorbar = barindex[i]hhmajorprice = high[i]endifif low[i]<llmajorprice thenllmajorbar=barindex[i]llmajorprice=low[i]endifnextsignal=0//atr=averagetruerange[14]if barindex-hhminorbar=PeriodsInMinorSwing thensignal=1r=100g=149b=237 //drawtext("●",hhminorbar,hhminorprice,Dialog,Bold,10) coloured(100,149,237)endifif barindex-llminorbar=PeriodsInMinorSwing thensignal=-1r=100g=149b=237//drawtext("●",llminorbar,llminorprice/1,Dialog,Bold,10) coloured(100,149,237)endifif barindex-hhmajorbar=PeriodsInMajorSwing thensignal=2r=128g=0b=128//drawtext("●",hhmajorbar,hhmajorprice+atr/2,Dialog,Bold,20) coloured(128,0,128)endifif barindex-llmajorbar=PeriodsInMajorSwing thensignal=-2r=128g=0b=128//drawtext("●",llmajorbar,llmajorprice-atr/2,Dialog,Bold,20) coloured(128,0,128)endifreturn signal coloured(r,g,b) style(histogram)//EMA coloured(184,134,11) as "EMA"02/03/2020 at 6:34 PM #118600Hello
I am afraid that for some reason it’s not lining up correctly with the price bars I can put last man standing in a chart of its own which I’ve done i’ve also put the histogram version on the chart and then price and Last Man Standing and you can see from the picture something’s not right just to remind you you why need it as a histogram was for visual backtesting and programmable backtesting if that makes any sense.
as well do you if could be return as a line then change the line by the drop down menu might be better, But obviously one thing at a time and I do so appreciate all the help thank you
12345678if c1 theni=0.2endifif c2 theni=-0.2endifreturn i as "LMS"02/04/2020 at 10:40 AM #11862702/04/2020 at 11:31 AM #118633Good morning Nicolas
Oh right see I didn’t understand the code I tried to,
So it’s just marking the highs and lows in the past and then painting them I actually thought it was a reversal indicator
-
AuthorPosts
Find exclusive trading pro-tools on