Parameter value entry via segment/line on price chart possible?
Forums › ProRealTime English forum › ProBuilder support › Parameter value entry via segment/line on price chart possible?
- This topic has 15 replies, 4 voices, and was last updated 5 years ago by s00071609.
-
-
09/25/2019 at 11:31 AM #108418
Hello all,
I am working on an indicator and I would like to involve the distance of price relative to four lines. Two horizontal (Resistance and Support) and two angling trendlines (Resistance and Support) so there will be these 4 lines only in my charts.
Would it be possible to have these 4 lines in the price chart and by moving a line, the corresponding parameter value of that line will change simultaiously in the code?
Tx in advance
09/25/2019 at 11:38 AM #108419No, it’s not possible. Automated strategies cannot communicate with charts.
1 user thanked author for this post.
09/25/2019 at 11:53 AM #108422Tx for quick reply. It will not be used for automated trading. The values will be used in the code as a variable to calculate my indicator, I now enter 2 Horizontal lines and enter these values in the Indicator code manually.
If It can not be done, I would like to add 2 angeling lines (trend support and trend resistance) with again manual entry of values in the code.
Does anyone have an example/idea?
09/25/2019 at 12:10 PM #108423No code can communicate with charts, you can only access data returned by PRT (close,high,low,open,…. and indicators).
What do you mean by “I would like to add 2 angeling lines (trend support and trend resistance) with again manual entry of values in the code“?
Can you post an example or screenshot?
But, as I already said, no code, be it a strategy, indicator or screener can detect objects drawn on charts, whether they are drawn by the user or by PRT itself (like optional trend lines).
1 user thanked author for this post.
09/25/2019 at 12:21 PM #10842609/29/2019 at 11:45 AM #108744As you say the code cannot communicate with the chart, would there is a possible way to get TIME Distance between 2 Points in a daily TF. These Two points are the Price A to Price B. For example, is there a way to tell, how many Bars (each bar is 1 day in daily) it formed beweed two price points A and B? All i need is either Time taken for price to move from price A to Price B or Bars formed between these two points in a TF say Daily TF.
If only the PRT codes could get values from draw objects or was able to get values from chart, building indicators would have been so much better to accommodate different users.
09/29/2019 at 1:13 PM #108748There you to count bars from two points, highest and lowest in this case (not tested):
123456789101112131415161718192021HH = highest[100](high)LL = lowest[100](low)PointA = 0PointB = 0For i = 0 To 99If PointA = 0 ThenIf HH = high[i] Or LL = low[i] ThenPointA = barindex[i]EndifElseIf HH = high[i] Or LL = low[i] ThenPointB = barindex[i]BreakEndifEndifNextBars = abs(PointA - PointB)DRAWTEXT(“#Bars# to go from #HH# to #LL#”,barindex,high+5*pipsize)DRAWSEGMENT(barindex-100,HH,barindex,HH)DRAWSEGMENT(barindex-100,LL,barindex,LL)Return09/29/2019 at 3:34 PM #108773I am not sure the code works as expected. Please see the screenshot
Its not 56 bars from point A to B.
One of the big problem i am seeing with many of the things I was trying is that – the particular price could occur at different points, because it does not allow picking points in chart when it comes to custom indicator, it prevents from building indicators that relies on user identifying the parameters in the chart.
I am not sure what the problem is here
09/29/2019 at 3:41 PM #10877609/29/2019 at 3:44 PM #108778Because my initial question was if it is possible to count bars between two price points. My indicator is based on manual entry of Price points as variables.
The arrow indicates the price points used in the indicator. I changed the POINT A and POINT B to the prices I want to count bars between.
09/29/2019 at 3:53 PM #10878109/29/2019 at 4:00 PM #108783No – All i changed was the POINT A value and POINT B value to price points. I changed 5,6 & 8. nothing else.
I might have misunderstood it. All i am trying to do here is get – how much time in days it took for price to reach from 1401 to 1535 – the points marked in screenshot.
In 100 bars this price may have been reached many times I guess.
Not too sure whats happening here
09/29/2019 at 4:40 PM #108786Roberto’s code was just an example of how it is possible to count how many candles are between two points but as he did not know how you select your two points then he had to use something else to select points. He chose highest high and lowest low in last 100 bars.
If you can’t set clear rules for how you select the points that you want then it is not possible to code an indicator as they generally like working with rules rather than working with ‘I like the look of that candle so I think that I might use that one’!
09/29/2019 at 5:41 PM #108799I understand what you are saying but in this case, counting bars between two given price points as variables has nothing to do with manual judgement. I believe this type of shortcoming is due to the fact that PRT cannot take data from drawing objects so it does not know where a Price is.
But in this case it should still be able to give the count of bars – for example if it starts from lowest 100 bars then finds the LOW ($1450) within the last 100 bars then counts bars until it finds the HIGH ($1650) within that 100 bars and gives what it has counted in that price range. All we are looking at is getting that section between the price. This should be possible I think.
But i doubt the way this will then work will help me in other market conditions, example in range bound market.
I think Roberto understood probably what i was asking, just not sure what i did was correct.
PS: Are there any Plans to have 3 Points based FIB TIME ZONE. Like the one Tradingview has
09/29/2019 at 5:56 PM #108800You can turn 100 periods, pointA and pointB into 3 variables that can be set manually with the indicator properties.
-
AuthorPosts
Find exclusive trading pro-tools on