- Katılım
- 23 Eki 2020
- Mesajlar
- 1,826
Hello, I would like to restrict the plotting of indicators on my charts to the last x number of periods. For example, when plotting weekly pivots on a daily chart, I would like to only plot lines for the current week and not every week back to the beginning of the chart. It would also be nice just to see, say, the end of an MA plot. I am currently using daysofweek but I am sure that it is not the most efficient way of doing it. Any suggestions for a more elegant solution? Thanks in advance. Kevin =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Hi Kevin, It can be done with this indicator. Should be self explanatory. If you need any help just let me know. Hope it helps, Preston |
|
Restricted Display {Written by Preston Umrysh} {Correctly Displays an indicator for a specified period of time} Pds:=Input("Indicator periods ",1,1111,10); DisPds:=Input("Select Display Periods",1,1111,10); BackPds:=Input("Select Setback Periods",0,1111,0); {Indicator} Ind:=Mov(C,pds,S);{Place your indicator here} {Restricted Display} ResPds:= Alert(BarsSince(Cum(1)=LastValue(Cum(1)-(DisPds+BackPds)) =1),1); Plot:=ValueWhen(1,ResPds,Ref(Ref(Ind,-BackPds),BackPds)); Plot; {end} |
Source / From: |