Extend horizontal line plot - futures io

# 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)

# Extend horizontal line plot

pr0crast
Tucson, AZ

Posts: 2 since Mar 2011

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)

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 dxFeedSierra Chart TradingView help in improving Anchored VwapPlatforms and Indicators Is there inherently more opportunity in smaller markets?Traders Hideout For the experts of MetastockPlatforms and Indicators

in the last 7 days on futures io
 Webinar: Happy Hour w/Cem Karsan27 thanks Avoiding Account Killing Freight Trains19 thanks QG mini Natural Gas ( Position size ) calculation19 thanks Webinar: Building a System for Trading Psychology w/Jare …15 thanks The Beast Slayer, Lances NQ Trading Journal14 thanks

 (login for full post details) #2 (permalink) cory  the coin hunter virginia   Experience: Intermediate Platform: ninja Trading: NQ     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

 (login for full post details) #3 (permalink) cory  the coin hunter virginia   Experience: Intermediate Platform: ninja Trading: NQ     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

 (login for full post details) #4 (permalink) WildWex  Elite Member Tarzana, CA   Experience: Intermediate Platform: TOS, TS, MC, NT8, MT4 Trading: Futures: ES, CL, NQ, HO, SI     Posts: 7 since Jul 2017 Thanks: 0 given, 3 received Hey Pr0crast - Did you ever figure this out?

cory
the coin hunter
virginia

Experience: Intermediate
Platform: ninja

Posts: 6,059 since Jun 2009

WildWex
 Hey Pr0crast - Did you ever figure this out?

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

 futures io > Extend horizontal line plot

Last Updated on January 7, 2018

Upcoming Webinars and Events