Extend horizontal line plot - ThinkOrSwim Programming | futures.io
futures.io futures trading

Go Back   futures.io

> Futures Trading, News, Charts and Platforms > Platforms and Indicators > ThinkOrSwim > ThinkOrSwim Programming

Extend horizontal line plot
Started:March 28th, 2011 (12:00 AM) by pr0crast Views / Replies:4,083 / 2
Last Reply:March 28th, 2011 (09:42 PM) Attachments:1

Welcome to futures.io.

Welcome, Guest!

This forum was established to help traders (especially futures traders) by openly sharing indicators, strategies, methods, trading journals and discussing the psychology of trading.

We are fundamentally different than most other trading forums:
  • We work extremely hard to keep things positive on our forums.
  • We do not tolerate rude behavior, trolling, or vendor advertising in posts.
  • We firmly believe in openness and encourage sharing. The holy grail is within you, it is not something tangible you can download.
  • We expect our members to participate and become a part of the community. Help yourself by helping others.

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, and we will never resell your private information.

-- Big Mike

Thread Tools Search this Thread

Extend horizontal line plot

Old March 28th, 2011, 12:00 AM   #1 (permalink)
Just starting out...
Tucson, AZ
Futures Experience: Intermediate
Platform: Thinkorswim
Favorite Futures: UNITED STATES
Posts: 2 since Mar 2011
Thanks: 0 given, 0 received

Extend horizontal line plot

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:

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;

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;

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

Old March 28th, 2011, 12:15 AM   #2 (permalink)
Elite Member
reston, va
Futures Experience: Intermediate
Platform: ninja
Favorite Futures: ES
cory's Avatar
Posts: 5,072 since Jun 2009
Thanks: 606 given, 6,067 received

pic from link, a lateral formation

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

Attached Thumbnails
Extend horizontal line plot-lat.png  
Reply With Quote


futures.io > Futures Trading, News, Charts and Platforms > Platforms and Indicators > ThinkOrSwim > ThinkOrSwim Programming > Extend horizontal line plot

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Upcoming Webinars and Events (4:30PM ET unless noted)

An Afternoon with FIO trader bobwest

Elite only

NinjaTrader 8: Programming Profitable Trading Edges w/Scott Hodson

Elite only

Anthony Drager: Executing on Intermarket Correlations & Order Flow, Part 2

Elite only

Adam Grimes: Five critically important keys to professional trading

Elite only

Machine Learning Concepts w/FIO member NJAMC

Elite only

MarketDelta Cloud Platform: Announcing new mobile features

Dec 1

NinjaTrader 8: Features and Enhancements

Dec 6

Similar Threads
Thread Thread Starter Forum Replies Last Post
Plot PIVOT POINTS as horizontal lines for trading sessions in MultiCharts virginiatrader The Elite Circle 7 June 22nd, 2013 03:28 PM
Where did Horizontal Price Line Indie Go? tdaman NinjaTrader 12 January 5th, 2012 01:29 PM
Drawing horizontal line wiithout changing grid distance. komalsid NinjaTrader 4 December 27th, 2010 02:50 PM
can you get a horizontal line at the current high of the volume indicator anniebee321 NinjaTrader 4 December 10th, 2010 05:18 PM
Horizontal line with text vast NinjaTrader Programming 2 February 4th, 2010 03:46 PM

All times are GMT -4. The time now is 03:11 AM.

Copyright © 2016 by 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

Page generated 2016-10-24 in 0.08 seconds with 21 queries on phoenix via your IP