Coding horizontal line at specific bar - futures io
futures io futures trading



Coding horizontal line at specific bar


Discussion in ThinkOrSwim

Updated by CodingDummy
    1. trending_up 692 views
    2. thumb_up 7 thanks given
    3. group 2 followers
    1. forum 12 replies
    2. attach_file 2 attachments




Welcome to futures io: the largest futures trading community on the planet, with well over 100,000 members
  • 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 and simple.

-- Big Mike, Site Administrator

(If you already have an account, login at the top of the page)

 
Search this Thread
 

Coding horizontal line at specific bar

(login for full post details)
  #11 (permalink)
Sacramento, California
 
 
Posts: 10 since Sep 2019
Thanks: 6 given, 1 received

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 futures io?
Tradestation outside the US
TradeStation
Tradovate - Im trading Micro E-Mini Futures - Do I need "Market Internals" data feed?
Emini and Emicro Index
Cumulative Bid/Ask Chart resets after 2Billion
MultiCharts
FYI plot bug & workaround: changing color or width is delayed 1 bar
EasyLanguage Programming
execute mes in es dom/footprint chart?
Sierra Chart
 
Best Threads (Most Thanked)
in the last 7 days on futures io
Is anyone actually making money?
182 thanks
Micro account vs Funded account (combine)
53 thanks
Are sharks watching on the other side?
30 thanks
Spoo-nalysis ES e-mini futures S&P 500
24 thanks
Life sacrifice loneliness trading futures
20 thanks
 
(login for full post details)
  #12 (permalink)
Legendary Market Wizard
Upstate NY
 
Experience: Intermediate
Platform: TOS
Trading: Equities, Treasuries, Gold
 
mtzimmer1's Avatar
 
Posts: 610 since Dec 2018
Thanks: 1,626 given, 1,309 received

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!

Visit my futures io Trade Journal Reply With Quote
 
(login for full post details)
  #13 (permalink)
Sacramento, California
 
 
Posts: 10 since Sep 2019
Thanks: 6 given, 1 received


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


futures io Trading Community Platforms and Indicators ThinkOrSwim > Coding horizontal line at specific bar


September 12, 2019


Upcoming Webinars and Events
 

Every journal equals ten meals for the hungry

Now
     



Copyright © 2020 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, +507 833-9432, info@futures.io
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.
no new posts