Adaption/addition to Last man standing indicator
Forums › ProRealTime English forum › ProBuilder support › Adaption/addition to Last man standing indicator
- This topic has 3 replies, 2 voices, and was last updated 1 year ago by edktrading.
Viewing 4 posts - 1 through 4 (of 4 total)
-
-
09/14/2023 at 9:04 AM #221006
Hi, I am using https://www.prorealcode.com/prorealtime-indicators/lastmanstanding-swing-indicator/.
Is it possible to draw a line between the last minor highs and the last minor lows. And how can I realize that?
See attatchment and code below.
Thanx in advance, Erik
Lastman standing1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859//PRC_LastManStandingIndicator | indicator//14.11.2017//Nicolas @ www.prorealcode.com//Sharing ProRealTime knowledge//translated from MQL4 code// --- settingsPeriodsInMajorSwing=13PeriodsInMinorSwing=5MovingAverageMethod=1MovingAveragePeriods= 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 then//drawtext("●",hhminorbar,hhminorprice,Dialog,Bold,10) coloured(100,149,237)drawtext("●",hhminorbar,hhminorprice,Dialog,Bold,10) coloured(255,255,0)endifif barindex-llminorbar=PeriodsInMinorSwing then//drawtext("●",llminorbar,llminorprice,Dialog,Bold,10) coloured(100,149,237)drawtext("●",llminorbar,llminorprice,Dialog,Bold,10) coloured(255,255,0)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 "lastman standing"09/14/2023 at 9:09 AM #22100709/14/2023 at 12:52 PM #221019Please find below the modified version that draw segments between the minor yellow points:
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465//PRC_LastManStandingIndicator | indicator//14.11.2017//Nicolas @ www.prorealcode.com//Sharing ProRealTime knowledge//translated from MQL4 code// --- settingsPeriodsInMajorSwing=13PeriodsInMinorSwing=5MovingAverageMethod=1MovingAveragePeriods= 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 then//drawtext("●",hhminorbar,hhminorprice,Dialog,Bold,10) coloured(100,149,237)drawtext("●",hhminorbar,hhminorprice,Dialog,Bold,10) coloured(255,255,0)drawsegment(hhminorbar,hhminorprice,prevhhminorbar,prevhhminorprice)prevhhminorbar=hhminorbarprevhhminorprice=hhminorpriceendifif barindex-llminorbar=PeriodsInMinorSwing then//drawtext("●",llminorbar,llminorprice,Dialog,Bold,10) coloured(100,149,237)drawtext("●",llminorbar,llminorprice,Dialog,Bold,10) coloured(255,255,0)drawsegment(llminorbar,llminorprice,prevllminorbar,prevllminorprice)prevllminorbar=llminorbarprevllminorprice=llminorpriceendifif 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 "lastman standing"09/14/2023 at 1:48 PM #221023Thank you very much Nicolas! This is very helpful for me.
-
AuthorPosts
Viewing 4 posts - 1 through 4 (of 4 total)
Find exclusive trading pro-tools on
Similar topics: