NexusFi: Find Your Edge


Home Menu

 





Coding horizontal line at specific bar


Discussion in ThinkOrSwim

Updated
    1. trending_up 4,515 views
    2. thumb_up 7 thanks given
    3. group 2 followers
    1. forum 12 posts
    2. attach_file 2 attachments




 
Search this Thread

Coding horizontal line at specific bar

  #11 (permalink)
CodingDummy
Sacramento, California
 
Posts: 10 since Sep 2019
Thanks Given: 6
Thanks Received: 1

Still having a problem with this one. I'm getting a horizontal line on every chart at 0.00 instead of the 16:00 - 16:05 5m candle closing price.

this is what i have inserted from your prior post as the script code....


declare upper;

input PeriodStartTime = 0458;
input PeriodEndTime = 0459;

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];

plot line2 = line_top;

Reply With Quote

Can you help answer these questions
from other members on NexusFi?
ZombieSqueeze
Platforms and Indicators
Quantum physics & Trading dynamics
The Elite Circle
Cheap historycal L1 data for stocks
Stocks and ETFs
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
Better Renko Gaps
The Elite Circle
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Funded Trader platforms
55 thanks
Just another trading journal: PA, Wyckoff & Trends
20 thanks
Self sabotage reframed
15 thanks
Trading with Intuition
15 thanks
FootPrintV2 Chart for NT8
8 thanks
  #12 (permalink)
 
mtzimmer1's Avatar
 mtzimmer1 
Upstate NY
Recovering Method Hopper
 
Experience: Intermediate
Platform: TOS
Broker: TD Ameritrade
Trading: Equities, Treasuries, Gold
Posts: 840 since Dec 2018
Thanks Given: 2,201
Thanks Received: 1,918

It’s not going to run on a daily chart.

I’m sure there is a way to do exactly what you’re looking for, I am just not sure how to do it!

Follow me on Twitter Visit my NexusFi Trade Journal Reply With Quote
  #13 (permalink)
CodingDummy
Sacramento, California
 
Posts: 10 since Sep 2019
Thanks Given: 6
Thanks Received: 1


I wasn't able to get it to work on any time frame, but then i made a small change. all the 1605 i made 1600 and all the 1606 i made 1605 and it worked great. Aqua Blue horizontal line appeared at the close of the candle i want.

However, the aqua line only extends for 5-6 bars. Is there another tweak to get this line to extend through the end of the trading day? so from the close of 16:05 candle yesterday through the end of trading hours today (1559)?

declare upper;

input PeriodStartTime = 0458;
input PeriodEndTime = 0459;

def Range_Top = if SecondsFromTime(1605) >= 0 then Range_Top[1] else
if SecondsFromTime(1600) == 0 then close else
if SecondsFromTime(1600) < 0 then Double.NaN else
if SecondsFromTime(1600) > 0 and SecondsFromTime(1605) <= 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];

plot line2 = line_top;

Reply With Quote




Last Updated on September 12, 2019


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts