Specific length on Drawhline
- This topic has 5 replies, 3 voices, and was last updated 4 years ago by .
Viewing 6 posts - 1 through 6 (of 6 total)
Viewing 6 posts - 1 through 6 (of 6 total)
Similar topics:
Forums › ProRealTime English forum › ProBuilder support › Specific length on Drawhline
Hello,
I am trying to make an indictaor with lines, but I dont want the lines to go on forever to the right of the screen. Is it possible to determine the length of “Drawhline”? For example 40bars. My screen gets all messy with all the lines and I am only interested in the recently drawn levels.
Thank you!
You can use DEFPARAM DISPLAYONLSTBARONLY=TRUE to only plot the last one (constantly displaying it again and again each new candle, until a new one replaces it). If you are interested in the last 3-4 lines you need to save them and shift them as soon as a new one occurs.
You can use segments to draw lines having a start and an end, see https://www.prorealcode.com/prorealtime-indicators/pivot-support-resistance-zones/.
roberto means DRAWONLASTBARONLY and not DISPLAYONLSTBARONLY!
https://www.prorealcode.com/documentation/drawonlastbaronly/
Hello,
Thank you Roberto and Vonasi. I have managed to Get a indicator that looks ok now 🙂
However, I made this indicator to visually see if one of my trading idea was worth proceeding with. Now, I am starting to code a system and got stuck directly. My “levels” that are drawn in the indicator is easy to find but I want them to still be there in X bars regardless if a new level forms. That is my problem. The level changes as soon as a new level forms. I tried to have a counter and I tried barindex, but I just cant get it to work. My basic code for the level is copied here as well as a picture of the levels from the indicator.
1 2 3 4 5 6 7 8 9 |
MA = average[1](close) slack =0.1 first1 =MA[10] < MA[5]// >Averagetruerange[10]*1 second1 = MA[5] - MA >Averagetruerange[10] IF first1 and second1 then HI1=Highest[10](close)+Averagetruerange[10]*Slack endif |
We need thw full working code to be of some help.
Hi Roberto,
Thank you for your reply. I understand, I will try to do something about that this week. The thing is, my code doesnt work :), but I will do as much as I can and then hopefully you can help me to get further. I will also attach my indicator file. As always, thank you for your prompt respond! I wouldnt have got a single system without your help.
Find exclusive trading pro-tools on