Premarket 50% line


Category:
0
0

Hi, I’m looking for a Premarket only indicator that will plot a 50% line between the Previous Day Close and Premarket High or Low.  I’m thinking like AutoFibonacci indicator, but only plots the 50% line only during Premarket.

Thanks very much for any assistance!

Attachments:
Marked as spam
Posted by (Questions: 2, Answers: 2)
Asked on April 19, 2019 6:57 am
207 views
0

I need to clarify this statement: “but only plots the 50% line only during Premarket.”

So did you only want the line to plot for the duration of the premarket period, and not plot during the regular session period? Or did you want this level plotted for both sessions?

( at April 23, 2019 10:38 am)
0

Hey Pete,
I only want PreMarket 50% line. Thanks very much!

( at April 23, 2019 11:00 am)
0

Please answer the question. The question is where do you want this plot to show up on the chart. Do you want it to show up for the entire chart or only for the premarket portion of the chart?

( at April 23, 2019 1:47 pm)
0

apologies… the entire chart. looking just like the image i attached to the original post

( at April 24, 2019 7:58 am)
0
Private answer

For this solution we are going to barrow some code provided in a previous request: https://www.hahn-tech.com/ans/premarket-study-on-chart/

That previous post links back to another so be sure to follow the links to get the full context. The original post you find will be a request for a premarket High/Low label. This code gives us all the structure we need to add in the 50% line. Be sure to read those previous posts so that you understand how to use this code:

input startTime = 400;
input endTime = 929;
input percentLevel = 0.5;
def timeUntilClose = SecondsTillTime(endTime);
def timeUntilOpen = SecondsTillTime(startTime);
def targetPeriod = timeUntilClose > 0;
rec targetPeriodHigh = if targetPeriod and !targetPeriod[1] then high else if targetPeriod and high > targetPeriodHigh[1] then high else targetPeriodHigh[1];
rec targetPeriodLow = if targetPeriod and !targetPeriod[1] then low else if targetPeriod and low < targetPeriodLow[1] and low > 0 then low else targetPeriodLow[1];
def pmHigh = targetPeriodHigh;
plot fiftyPercentLine = ((pmHigh - close(period = AggregationPeriod.DAY)[1]) * percentLevel) + close(period = AggregationPeriod.DAY)[1];

Screenshot below shows the result. Note that the previous day close and premarket high lines have been drawn on the chart by hand. This code only plots the 50% line.

Attachments:
Marked as spam
Posted by (Questions: 37, Answers: 4118)
Answered on April 29, 2019 12:08 pm