Plot Custom Lines On Chart


Category:
0
0

Hi Pete, 

I am looking for a study which plots the lines as per following.

Example – Input# 1 – Input time open price, Input # 2 – Multiplier for line 

If I have the input time 930 AM and 930 AM open price is 2900 and I select multiplier as 5 , then I have the lines on chart at 2885, 2880, 2875, 2870, 2865, 2860, 2855, 2850, 2845, 2840 and similarly on upside I have the lines at 2905, 2910, 2915, 2920, 2925, 2930, 2935, 2940, 2945, 2950,2955.

Thank you,

Shaishav 

 

RESOLVED
Marked as spam
Posted by (Questions: 49, Answers: 62)
Asked on May 9, 2020 8:18 pm
102 views
0
Private answer

Plots on a chart do not work that way. I see that you want to apply a "multiplier" so that each of the successive lines are plotted a fixed amount away from the original line. However each and every single line you want to plot need to be hard coded into the chart study. You have listed 21 unique values as your example. So each and every one of those 21 plots must be written into the code of the chart study.

This would take far more time than I permit for a free solution in the Q&A forum.

So I will give you the first three lines and you can work out the rest:

input targetTime = 930;
input increment = 5;
rec targetOpen = if SecondsTillTime(targetTime) == 0 then open else targetOpen[1];
plot priceOpen = targetOpen;
plot pricePluseOne = targetOpen + increment;
plot priceMinusOne = targetOpen - increment;

Marked as spam
Posted by (Questions: 37, Answers: 4087)
Answered on May 10, 2020 9:50 am
0
Thank you Pete. I will work out the rest.
( at May 10, 2020 12:25 pm)