Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now for Free
Genuine reviews from real traders, not fake reviews from stealth vendors
Quality education from leading professional traders
We are a friendly, helpful, and positive community
We do not tolerate rude behavior, trolling, or vendors advertising in posts
We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community. It's free for basic access, or support us by becoming an Elite Member -- see if you qualify for a discount below.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
I want a light blue colored horizontal line drawn using the closing price of the first 5 minute candle in after hours trading (the one from 16:00-16:05 EST). Wherever this candle closes, a horizontal line is drawn in light blue that shows price level name as "LIS" and shows Price on the right. No matter what time frame we move to I want this line to be permanent for the next trading day only. Each day a new line is generated and we don’t see any prior lines.
Based on SHAK today (9/9/19), that line would be generated at 102.66 from 16:05 today (9/19). i don't care how long it extends into the future as long as it covers the entire trading day that follows.
please help me, i'm a coding dummy
Can you help answer these questions from other members on NexusFi?
Right... ya need another “else” after the “else if” in case neither of the aforementioned conditions are met. Adding an “else double.nan” at the end of the string would resolve it I think?
here is what the SHAK chart would look like.
the 16:00-16:05 candle closed at 102.66, so i have manually drawn the aqua line from the 16:00 mark as seen in the picture.
i change time frames, so what i want to happen is that when i go from 5m chart to 4hr or daily chart that the line does not then move to the closing price of those charts. always needs to reference that 5min closing price on the 16:00-16:05 candle.
Hey man, this DOES work but it is not pretty. You need to enter periodstarttime as the first 1 minute bar that prints in the pre-market trading hours. Also the periodendtime as the periodstarttime + 0001. Sorry I was unable to create a prettier code!
def Range_Top = if SecondsFromTime(1606) >= 0 then Range_Top[1] else
if SecondsFromTime(1605) == 0 then close else
if SecondsFromTime(1605) < 0 then Double.NaN else
if SecondsFromTime(1605) > 0 and SecondsFromTime(1606) <= 0
and close > Range_Top[1] then close else Range_Top[1];
plot line = Range_Top;
def line_Top = if SecondsFromTime(periodendtime) >= 0 then line_Top[1] else
if SecondsFromTime(PeriodStartTime) == 0 then line[1] else
if SecondsFromTime(PeriodStartTime) < 0 then Double.NaN else
if SecondsFromTime(PeriodStartTime) > 0 and SecondsFromTime(PeriodEndTime) <= 0
and line[1] > line_Top[1] then line[1] else line_Top[1];