Timed breakout box - EasyLanguage Programming | futures io social day trading
futures io futures trading


Timed breakout box
Updated: Views / Replies:4,610 / 17
Created: by TwoHands Attachments:3

Welcome to futures io.

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

futures io is the largest futures trading community on the planet, with over 90,000 members. At futures io, our goal has always been and always will be to create a friendly, positive, forward-thinking community where members can openly share and discuss everything the world of trading has to offer. The community is one of the friendliest you will find on any subject, with members going out of their way to help others. Some of the primary differences between futures io and other trading sites revolve around the standards of our community. Those standards include a code of conduct for our members, as well as extremely high standards that govern which partners we do business with, and which products or services we recommend to our members.

At futures io, our focus is on quality education. No hype, gimmicks, or secret sauce. The truth is: trading is hard. To succeed, you need to surround yourself with the right support system, educational content, and trading mentors – all of which you can find on futures io, utilizing our social trading environment.

With futures io, you can find honest trading reviews on brokers, trading rooms, indicator packages, trading strategies, and much more. Our trading review process is highly moderated to ensure that only genuine users are allowed, so you don’t need to worry about fake reviews.

We are fundamentally different than most other trading sites:
  • We are here to help. Just let us know what you need.
  • We work extremely hard to keep things positive in our community.
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts.
  • We firmly believe in and encourage sharing. The holy grail is within you, we can help you find it.
  • 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.

-- Big Mike, Site Administrator

Reply
 3  
 
Thread Tools Search this Thread
 

Timed breakout box

  #11 (permalink)
Elite Member
Fort Lauderdale, Florida
 
Futures Experience: Beginner
Platform: TradeStation
Favorite Futures: ES
 
Posts: 111 since Apr 2011
Thanks: 97 given, 149 received

Thanks Program but this one didn't compile either: it calls Time_s an unknown identifier.

Reply With Quote
 
  #12 (permalink)
Scarecrow
CA USA
 
Futures Experience: Intermediate
Platform: MultiCharts
Broker/Data: DDT+land/Rithmic/IQ
Favorite Futures: S&P500,6E,YM
 
program's Avatar
 
Posts: 100 since Nov 2010
Thanks: 127 given, 63 received


TwoHands View Post
Thanks Program but this one didn't compile either: it calls Time_s an unknown identifier.

I've never used TS, so i probably won't be able help much more... that being said, try changing Time_s to Time easylanguage and powerlanguage "should" be very close.

I have approximate answers, possible beliefs and different degrees of certainty of different things. But I'm not absolutely sure of anything and there are many things i don't know anything about.
Reply With Quote
The following user says Thank You to program for this post:
 
  #13 (permalink)
Elite Member
Fort Lauderdale, Florida
 
Futures Experience: Beginner
Platform: TradeStation
Favorite Futures: ES
 
Posts: 111 since Apr 2011
Thanks: 97 given, 149 received


As it turns out, TS has a built in indicator called Subsession Hi Lo lines that, except for some minor display tweaks I'd prefer, does almost exactly what I want. Thanks much for your effort.

Reply With Quote
 
  #14 (permalink)
Trading for Fun
London
 
Futures Experience: None
Platform: mc, TS, ninja
Favorite Futures: es
 
Bimi's Avatar
 
Posts: 118 since Mar 2010
Thanks: 42 given, 58 received


TwoHands View Post
Has anyone written or know where I can find a breakout box? I'd like it to allow me to input start and end times and show the high and low of that period. Also need it to automatically change for each day based on the chart's session hours.

The image is using manually entered horizontal and vertical lines to give an idea what I'm looking for.

Please register on futures.io to view futures trading content such as post attachment(s), image(s), and screenshot(s).

do you need it for backtest? or to run it real time?

Reply With Quote
 
  #15 (permalink)
Elite Member
Fort Lauderdale, Florida
 
Futures Experience: Beginner
Platform: TradeStation
Favorite Futures: ES
 
Posts: 111 since Apr 2011
Thanks: 97 given, 149 received


Bimi View Post
do you need it for backtest? or to run it real time?

Preferably both but since I have no coding skills I'm having to do my testing real time, viewing daily charts that go back a year or so. I know it's Jesse Livermore-ish but until I learn to program {something I haven't done in 30 years} it's what I've got to work with.

Reply With Quote
 
  #16 (permalink)
Elite Member
Fort Lauderdale, Florida
 
Futures Experience: Beginner
Platform: TradeStation
Favorite Futures: ES
 
Posts: 111 since Apr 2011
Thanks: 97 given, 149 received

Big Mike has given me permission to post the source of the original Tradestation indicator called Subsession Hi Lo Lines hoping that someone can help me get this working the way I want. I'm also posting code from one of the TS employees who made some ineffective changes and then lost interest.

This is a screenshot of several days on a 15 minute chart using TS's original indicator. It allows me to input start and end times and plots the lines for the hi & lo of that period.

Please register on futures.io to view futures trading content such as post attachment(s), image(s), and screenshot(s).



 
Code
{ 
This indicator is designed to plot the period high and low for a time period set by
the "StartTime" and "EndTime" inputs.  The OHLCV calculations are reset when the new
time period starts as evaluated by the "ResetCalcs" calculations.  

This indicator is intended for application only to intraday bars (tick or time-
based).  

Commentary on the use of vectors for OHLCV, along with calculation explanations,
can be found in the "OHLCVCollection" function.
}

{ code will use classes from these namespaces }
using elsystem ;
using elsystem.collections ;

inputs:
	int NumSubSessionsAgo( 1 ), { number of sub-sessions ago;  use zero to refer to
	 the current sub-session }
	int StartTime( 0930 ), { start time for OHLCV calculations }
	int EndTime( 1600 ) ; { end time for OHLCV calculations }
	
variables:
	Vector OHLCV_Vector( NULL ), { this is the vector that will be passed by
	 reference to the function OHLCVCollection;  it will hold all the OHLCV values }
	Vector HighVector( NULL ), { High Prices }
	Vector LowVector( NULL ), { Low Prices }
	bool ResetCalcs( false ),
	bool IncludeThisBar( false ),
	int RtnValOrErrorCode( 0 ), { variable to hold the value returned by call to
	 OHLCVCollection function }
	intrabarpersist bool ValuesAvailable( false ), { used to ensure that there is
	 enough data in the vector before requesting a value }
	double SubSessionHigh( -1 ), { holds High of NumSessionsAgo }
	double SubSessionLow( -1 ) ; { holds Low of NumSubSessionAgo }
		
{ check bar type;  instantiate the vectors }	
method void Init( Object InitSender, InitializedEventArgs InitArgs ) 
	begin
	
	if BarType >= 2 then 
		RaiseRuntimeError( "Price Channel (Time-based) can be applied to " +
		 "intraday bars only." ) ;
	
	OHLCV_Vector = new Vector ;
	HighVector = new Vector ;	
	LowVector = new Vector ;
	
	end ;

{ condition upon which OHLCV values will be reset for next period }
ResetCalcs = ( Time > StartTime and Time[1] <= StartTime )
	or ( Time > StartTime and Time[1] > Time )
    or ( Time[1] > Time and StartTime > Time[1] ) ;

{
IncludeThisBar is passed in to OHLCVCollection to designate whether this bar is to 
be used in the OHLCV calcultions.  This variable is true if the bar falls within the
time frame established by the StartTime and EndTime inputs and false if the bar is
outside the time frame.
}
IncludeThisBar = IFFLogic( StartTime > EndTime, Time > StartTime or Time <= EndTime,
 Time > StartTime and Time <= EndTime ) ;

RtnValOrErrorCode = OHLCVCollection( ResetCalcs, IncludeThisBar, OHLCV_Vector ) ;

{ set-up HighVector and LowVector }
once 
	begin
	HighVector = OHLCV_Vector[1] astype Vector ; { [1] = High Price }
	LowVector = OHLCV_Vector[2] astype Vector ;  { [2] = Low Price }
	end ;
	
{ only allow retrieval of data once there is enough data loaded into the vector }
once ( RtnValOrErrorCode > NumSubSessionsAgo ) 
	ValuesAvailable = true ;

if ValuesAvailable then
	begin
	SubSessionHigh = HighVector.At( NumSubSessionsAgo ) astype double ;
	SubSessionLow = LowVector.At( NumSubSessionsAgo ) astype double ;
	Plot1( SubSessionHigh, "SubSessHigh" ) ;
	Plot2( SubSessionLow, "SubSessLow" ) ;
	end
else if LastBarOnChart then
	RaiseRuntimeError( "High and low not available for requested session.  " +
	 "Try loading more historical data or increasing 'load additional bars'" +
	 " setting." ) ;


{ ** Copyright (c) 2001 - 2010 TradeStation Technologies, Inc. All rights reserved. ** 
  ** TradeStation reserves the right to modify or overwrite this analysis technique 
     with each release. ** }
I made some requests in the TS forum and one of the TS coders came back with another version of it. I asked for

1. No need for the indi to plot beyond session hours
2. No need to show variations in the hi/lo for the input period
3. Text labels showing the value of the lines.


He came back with code that displays strangely…

Please register on futures.io to view futures trading content such as post attachment(s), image(s), and screenshot(s).


His code plots correctly if I use the previous day's data on todays chart, which I don't want -- it's a breakout strategy so it needs todays data. When I use todays data, this is what I get. I have no idea how he calculated the ending point so I don't know why the lines are angled.

His code:

 
Code
{  
This indicator is designed to plot the period high and low for a time period set by 
the "StartTime" and "EndTime" inputs.  The OHLCV calculations are reset when the new 
time period starts as evaluated by the "ResetCalcs" calculations.   
 
This indicator is intended for application only to intraday bars (tick or time- 
based).   
 
Commentary on the use of vectors for OHLCV, along with calculation explanations, 
can be found in the "OHLCVCollection" function. 
 
*** This indicator was customized to allow the start and ending times of when 
    the trend lines are draw can be controlled with inputs and the trend line 
    values are labeled. 
} 
 
{ code will use classes from these namespaces } 
using elsystem ; 
using elsystem.collections ; 
 
inputs: 
	int NumSubSessionsAgo( 0 ), { number of sub-sessions ago;  use zero to refer to 
	 the current sub-session } 
	int StartTime( 1200 ), { start time for OHLCV calculations } 
	int EndTime( 1300 ), { end time for OHLCV calculations } 
	 
	int DrawStartTime( 1200 ),  //  *** user input to control when trend lines start 
	int DrawEndTime( 1600 ) ;   //  *** user input to control when trend lines end 
	 
variables: 
	Vector OHLCV_Vector( NULL ), { this is the vector that will be passed by 
	 reference to the function OHLCVCollection;  it will hold all the OHLCV values } 
	Vector HighVector( NULL ), { High Prices } 
	Vector LowVector( NULL ), { Low Prices } 
	bool ResetCalcs( false ), 
	bool IncludeThisBar( false ), 
	int RtnValOrErrorCode( 0 ), { variable to hold the value returned by call to 
	 OHLCVCollection function } 
	intrabarpersist bool ValuesAvailable( false ), { used to ensure that there is 
	 enough data in the vector before requesting a value } 
	double SubSessionHigh( -1 ), { holds High of NumSessionsAgo } 
	double SubSessionLow( -1 ), { holds Low of NumSubSessionAgo } 
	 
	Int HighTLID( 0 ),  //  *** add these variables 
	Int LowTLID( 0 ),   //  *** add these variables 
	 
	Int TextID( 0 ) ;    //  *** add these variables 
 
//  *** Change from Init to InitializeComponent so this code runs 
//  first thing before the OHLCVCollections function does, else we 
//  we will get an object not found error 
method override void InitializeComponent() begin 
		 
	if BarType >= 2 then  
		RaiseRuntimeError( "Price Channel (Time-based) can be applied to " + 
		 "intraday bars only." ) ; 
	 
	OHLCV_Vector = new Vector ; 
	HighVector = new Vector ;	 
	LowVector = new Vector ; 
	 
end ; 
 
{ condition upon which OHLCV values will be reset for next period } 
ResetCalcs = ( Time > StartTime and Time[1] <= StartTime ) 
	or ( Time > StartTime and Time[1] > Time ) 
    or ( Time[1] > Time and StartTime > Time[1] ) ; 
 
{ 
IncludeThisBar is passed in to OHLCVCollection to designate whether this bar is to  
be used in the OHLCV calcultions.  This variable is true if the bar falls within the 
time frame established by the StartTime and EndTime inputs and false if the bar is 
outside the time frame. 
} 
IncludeThisBar = IFFLogic( StartTime > EndTime, Time > StartTime or Time <= EndTime, 
 Time > StartTime and Time <= EndTime ) ; 
 
RtnValOrErrorCode = OHLCVCollection( ResetCalcs, IncludeThisBar, OHLCV_Vector ) ; 
 
{ set-up HighVector and LowVector } 
once  
	begin 
	HighVector = OHLCV_Vector[1] astype Vector ; { [1] = High Price } 
	LowVector = OHLCV_Vector[2] astype Vector ;  { [2] = Low Price } 
	end ; 
	 
{ only allow retrieval of data once there is enough data loaded into the vector } 
once ( RtnValOrErrorCode > NumSubSessionsAgo )  
	ValuesAvailable = true ; 
 
if ValuesAvailable then begin 
	 
	SubSessionHigh = HighVector.At( NumSubSessionsAgo ) astype double ; 
	SubSessionLow = LowVector.At( NumSubSessionsAgo ) astype double ; 
	 
	//  *** If the prior bar time is less than the draw start time but the 
	//  current bar time is greater than the draw start time then we are on the 
	//  first bar of the draw time window, so create the high and low trend lines 
	//  as initial points with the start and end values 
	if Time[1] < DrawStartTime and Time >= DrawStartTime then begin 
	 
		HighTLID = TL_New( Date, Time, SubSessionHigh, Date, Time, SubSessionHigh ) ; 
		LowTLID  = TL_New( Date, Time, SubSessionLow, Date, Time, SubSessionLow ) ;	 
		 
		//  Set the high trend line to light blue and the low trend line to purple 
		Value1 = TL_SetColor( HighTLID, Cyan ) ; 
		Value1 = TL_SetColor( LowTLID, Magenta ) ; 
		 
		//  Create a text label of the subsession high value above the subsession high trend line 
		TextID = Text_New( Date, Time, SubSessionHigh, NumToStr( SubSessionHigh, 2 ) ) ; 
		Value1 = Text_SetStyle( TextID, 0, 1 ) ;  //  Place label to the right and above trend line 
		 
		//  Create a text label of the subsession low value below the subsession low trend line		 
		TextID = Text_New( Date, Time, SubSessionLow, NumToStr( SubSessionLow, 2 ) ) ; 
		Value1 = Text_SetStyle( TextID, 0, 0 ) ;   //  Place label to the right and below trend line	  
			 
	end 
	 
	//  *** Else if we have a high trend line ID defined and the time is between 
	//      the draw start and end times, stretch out the end of the high and low 
	//      trend lines to the current date/time 
	else if HighTLID > 0 and Time >= DrawStartTime and Time <= DrawEndTime then begin 
		Value1 = TL_SetEnd( HighTLID, Date, Time, SubSessionHigh ) ; 
		Value1 = TL_SetEnd( LowTLID,  Date, Time, SubSessionLow ) ;	 
	end ; 
	 
end 
else if LastBarOnChart then 
	RaiseRuntimeError( "High and low not available for requested session.  " + 
	 "Try loading more historical data or increasing 'load additional bars'" + 
	 " setting." ) ;
I'm grateful to anyone that can tweak this for me.

Reply With Quote
 
  #17 (permalink)
Site Administrator
Manta, Ecuador
 
Futures Experience: Advanced
Platform: My own custom solution
Favorite Futures: E-mini ES S&P 500
 
Big Mike's Avatar
 
Posts: 46,240 since Jun 2009
Thanks: 29,353 given, 83,234 received

@TwoHands, is this a "timed breakout box"?

If not, you might also post here:

https://futures.io/elite-circle/11130-want-your-easylanguage-indicator-created-free.html

Mike

Due to time constraints, please do not PM me if your question can be resolved or answered on the forum.

Need help?
1) Stop changing things. No new indicators, charts, or methods. Be consistent with what is in front of you first.
2) Start a journal and post to it daily with the trades you made to show your strengths and weaknesses.
3) Set goals for yourself to reach daily. Make them about how you trade, not how much money you make.
4) Accept responsibility for your actions. Stop looking elsewhere to explain away poor performance.
5) Where to start as a trader? Watch this webinar and read this thread for hundreds of questions and answers.
6)
Help using the forum? Watch this video to learn general tips on using the site.

If you want
to support our community, become an Elite Member.

Reply With Quote
 
  #18 (permalink)
Elite Member
Fort Lauderdale, Florida
 
Futures Experience: Beginner
Platform: TradeStation
Favorite Futures: ES
 
Posts: 111 since Apr 2011
Thanks: 97 given, 149 received


Big Mike View Post

Thanks Mike. Moved it here, retitled it Open Range indicator.

Reply With Quote

Reply



futures io > > > > > Timed breakout box

Thread Tools Search this Thread
Search this Thread:

Advanced Search



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

Jigsaw Trading: TBA

Elite only

FuturesTrader71: TBA

Elite only

NinjaTrader: TBA

Jan 18

RandBots: TBA

Jan 23

GFF Brokers & CME Group: Futures & Bitcoin

Elite only

Adam Grimes: TBA

Elite only

Ran Aroussi: TBA

Elite only
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
News Breakout!! kinkeadfx Currency Futures 1 July 25th, 2011 09:40 PM
Volume Breakout help ?.... isarhodes NinjaTrader Programming 3 July 11th, 2011 01:52 PM
Stall during breakout equals... ? josh Traders Hideout 2 March 19th, 2011 02:48 PM
CL Breakout tderrick Commodities Futures Trading 2 October 6th, 2010 01:08 PM
Timed exit in auto strategy nanobiotech NinjaTrader Programming 2 December 28th, 2009 08:57 PM


All times are GMT -4. The time now is 09:44 PM.

Copyright © 2017 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
Page generated 2017-12-15 in 0.12 seconds with 20 queries on phoenix via your IP 54.91.171.137