Extend horizontal line plot - futures io
futures io



Extend horizontal line plot


Discussion in ThinkOrSwim

Updated
    1. trending_up 9,371 views
    2. thumb_up 0 thanks given
    3. group 4 followers
    1. forum 4 posts
    2. attach_file 1 attachments




Welcome to futures io: the largest futures trading community on the planet, with well over 125,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
 

Extend horizontal line plot

(login for full post details)
  #1 (permalink)
pr0crast
Tucson, AZ
 
 
Posts: 2 since Mar 2011
Thanks: 0 given, 0 received

Hi all,

Is it possible to plot something on a PREVIOUS bar based on a condition met by a LATER bar?

For example, this script creates a lateral boundaries based on the logic that two inside bars followed an initial bar, and bars 4+ closed within the range of the initial bar. The only problem is because the condition to generate the lateral lines is only met by the 3rd bar, I cannot get the line to extend to the first two bars retroactively. Any guidance would be appreciated.

Here's the code:

 
Code
declare upper;
declare real_size;
rec inLateralBar3 = high[0] <= high[2] && high[1] <= high[2] && low[0] >= low[2] && low[1] >= low[2];
rec inLateralBar4 = inLateralBar3[1] && close <= high[3] && close >= low[3]; 
rec inLateralBar5 = inLateralBar4[1] && close <= high[4] && close >= low[4];

plot LatTop = if inLateralBar3[0] then (high[2])
    else if InLateralBar4[0] then (high[3]) 
    else if inLateralBar5[0] then (high[4])
    else Double.NAN;
LatTop.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
LatTop.SetDefaultColor(Color.yellow);
LatTop.SetLineWeight(2);
LatTop.HideBubble();
LatTop.HideTitle();

plot LatBot = if inLateralBar3[0] then (low[2])
    else if InLateralBar4[0] then (low[3]) 
    else if inLateralBar5[0] then (low[4])
else Double.NAN;
LatBot.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
LatBot.SetDefaultColor(Color.yellow);
LatBot.SetLineWeight(2);
LatBot.HideBubble();
LatBot.HideTitle();
Result:

h t t p : / / content.screencast.com/users/anon233/folders/Snagit/media/36c8dab3-91c3-4445-9152-e42ab04a5f1b/03.27.2011-20.57.25.png

(sorry, can't post images -- don't have 5 posts yet)

Reply With Quote

Can you help answer these questions
from other members on futures io?
MacdBB V402 NT804 + gradient + pullback not working on N …
NinjaTrader
Eurex Denali vs dxFeed
Sierra Chart
TradingView help in improving Anchored Vwap
Platforms and Indicators
Is there inherently more opportunity in smaller markets?
Traders Hideout
For the experts of Metastock
Platforms and Indicators
 
 
(login for full post details)
  #2 (permalink)
 cory 
the coin hunter
virginia
 
Experience: Intermediate
Platform: ninja
Trading: NQ
 
cory's Avatar
 
Posts: 6,059 since Jun 2009
Thanks: 858 given, 7,943 received

pic from link, a lateral formation

could you draw them first and delete them when condition is not met.

Attached Thumbnails
Click image for larger version

Name:	lat.png
Views:	88
Size:	4.2 KB
ID:	35144  
Reply With Quote
 
(login for full post details)
  #3 (permalink)
 cory 
the coin hunter
virginia
 
Experience: Intermediate
Platform: ninja
Trading: NQ
 
cory's Avatar
 
Posts: 6,059 since Jun 2009
Thanks: 858 given, 7,943 received


have you try this resource
Thinkscript Overview Read the Prospectus
this looks promising
Shaded Opening Range Indicator for Think or Swim Read the Prospectus

Reply With Quote
 
(login for full post details)
  #4 (permalink)
 WildWex 
Tarzana, CA
 
Experience: Intermediate
Platform: TOS, TS, MC, NT8, MT4
Trading: Futures: ES, CL, NQ, HO, SI
 
WildWex's Avatar
 
Posts: 7 since Jul 2017
Thanks: 0 given, 3 received

Hey Pr0crast -

Did you ever figure this out?

Reply With Quote
 
(login for full post details)
  #5 (permalink)
 cory 
the coin hunter
virginia
 
Experience: Intermediate
Platform: ninja
Trading: NQ
 
cory's Avatar
 
Posts: 6,059 since Jun 2009
Thanks: 858 given, 7,943 received


WildWex View Post
Hey Pr0crast -

Did you ever figure this out?

he's not going to answer you after after just 1 post in 6 years.

Reply With Quote


futures io Trading Community Platforms and Indicators ThinkOrSwim > Extend horizontal line plot


Last Updated on January 7, 2018


Upcoming Webinars and Events
 

NinjaTrader Indicator Challenge!

Ongoing
 

Our 12-year anniversary w/ $$,$$$ prizes (check soon)

August
     



Copyright © 2021 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada), 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