Opening Range Breakout - EasyLanguage Programming | futures io social day trading
futures io futures trading


Opening Range Breakout
Updated: Views / Replies:14,888 / 48
Created: by ptcm Attachments:7

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
 7  
 
Thread Tools Search this Thread
 

Opening Range Breakout

  #1 (permalink)
Elite Member
Taiwan
 
Futures Experience: Intermediate
Platform: TradeStation
 
Posts: 40 since Jun 2010
Thanks: 6 given, 11 received

Opening Range Breakout

I have coded the opening range breakout(quite a few hedge funds actually traded this strategies to make money in ES), but somehow the signals are not being generated correctly. Can someone please point me to the right direction ? The codes work on TS2000i but after importing into MC, it doesn't work anymore. ESL expert. please help!! many thanks.


data1 = 5 min, data2 = daily


Input: orb(0.3);
Variables: MyTrueRange(0), PreTrueRange(0),tempOpen(0), answer(0), answerSell(0);

If date <> date[1] then begin
DailyOpen = Open;
PreTrueRange = TrueHigh[1] of data2 - TrueLow[1] of data2;
end;


answer = DailyOpen + (PreTrueRange * orb);
answerSell = DailyOpen - (PreTrueRange * orb);

IF Close >= DailyOpen + (PreTrueRange * orb) THEN BEGIN

{**********************************************************}
IF MarketPosition = -1 THEN Buy To Cover ("EXIT SHORT") THIS BAR ON CLOSE;


END;
{**********************************************************}
if MarketPosition = 0 THEN BEGIN;
BUY ("LONG +") 4 CONTRACTS NEXT BAR ON CLOSE;
end;
{**********************************************************}
IF MarketPosition = 1 THEN BEGIN

Alert("Still Long");
END;

END;



{*********************************************************************************************************}
{* SELL SIGNALS ARE HERE*}


IF Close <= DailyOpen - (PreTrueRange * orb) THEN BEGIN

{**********************************************************}

{IF MarketPosition = -1 THEN BEGIN
Alert("Still Short");
END;}



{**********************************************************}

IF MarketPosition = 0 THEN SELL ("SHORT") 4 CONTRACTS THIS BAR ON CLOSE;

END;
{**********************************************************}
IF MarketPosition = 1 THEN BEGIN

sell ("EXIT LONG") THIS BAR ON CLOSE;

end;

END;

Reply With Quote
The following 2 users say Thank You to ptcm for this post:
 
  #2 (permalink)
Quick Summary
Quick Summary Post

Quick Summary is created and edited by users like you... Add FAQ's, Links and other Relevant Information by clicking the edit button in the lower right hand corner of this message.

 
  #3 (permalink)
 Vendor: www.systemtradersuccess.com 
Gurnee, IL
 
Futures Experience: Advanced
Platform: TradeStation
Broker/Data: TradeStation
Favorite Futures: Futures
 
Posts: 46 since Apr 2010
Thanks: 17 given, 92 received



ptcm View Post
I have coded the opening range breakout(quite a few hedge funds actually traded this strategies to make money in ES), but somehow the signals are not being generated correctly. Can someone please point me to the right direction ? The codes work on TS2000i but after importing into MC, it doesn't work anymore. ESL expert. please help!! many thanks.

I work with TradeStation with EasyLanguage. I took your code and it would not compile. There was also a few things about your code that made no sense to me. I made a few modifications and it now works under TradeStation 8.8. You might have to change the times since they are based on my time zone here in Chicago.

You should be able to take this to MC and compile it. Let me know if you have any questions.

 
Code
Input:
   orb(0.3);
Variables:
   MP(0),
   TodaysOpen(0),
   MyTrueRange(0), 
   PreTrueRange(0),
   tempOpen(0), 
   answer(0), 
   answerSell(0);

MP = MarketPosition;

// New Day

If date <> date[1] then begin
   TodaysOpen = Open;
   PreTrueRange = TrueHigh[1] of data2 - TrueLow[1] of data2;
   answer = TodaysOpen + (PreTrueRange * orb);
   answerSell = TodaysOpen - (PreTrueRange * orb);
end;

// Enter trade on breakout

If ( Time >= 900 ) And ( Time <= 1430 ) And ( MP = 0 ) And ( EntriesToday(Date) = 0 )  Then
Begin
   Buy ("LE") next bar at answer stop;
   Sellshort("SE") next bar at answerSell stop;
End;

// Stop Loss

If ( MP = 1 ) Then Sell next bar at answerSell stop;
If ( MP = -1 ) Then Buy to cover next bar at answer stop;
   
// Exit at end-of-day

If ( Time = 1500 ) And ( MP <> 0 ) Then
Begin
   Sell this bar at close;
   Buy to cover this bar at close;
End;

{************************************************* *********}
IF MarketPosition = 1 THEN BEGIN
Alert("Still Long");
END;

Reply With Quote
The following 6 users say Thank You to Jeff65 for this post:
 
  #4 (permalink)
Elite Member
Scottsdale, Arizona, USA and Puerto Penasco, Mx
 
Futures Experience: Intermediate
Platform: Ninja 7, TOS
Favorite Futures: YM, ES, GC, CL
 
DougN's Avatar
 
Posts: 37 since Nov 2013
Thanks: 28 given, 28 received

ELD file question

Luckily I have found a couple of indicators here for Tradestation that would be useful. When the code is installed into the indicator list through Easylanguage the end result is that it is grayed out and says next to it "not verified". Can someone tell what step I'm missing on installing this code into Tradestation? I have searched the forums for the answer but just not searching correctly or???.

Thanks all.
Doug

Reply With Quote
 
  #5 (permalink)
Market Wizard
Hamburg Germany
 
Futures Experience: Advanced
Platform: Multicharts, Tradestation, Multicharts.NET, NinjaTrader, MetaTrader
Broker/Data: DTN IQ
Favorite Futures: ES
 
Posts: 1,524 since Apr 2013
Thanks: 229 given, 852 received
Forum Reputation: Legendary

DougN,

if you open the code in the editor and try to verify it, it will probably give you an error. What is the error message and can you post the code?

Regards,
ABCTG

Reply With Quote
The following user says Thank You to ABCTG for this post:
 
  #6 (permalink)
Elite Member
Scottsdale, Arizona, USA and Puerto Penasco, Mx
 
Futures Experience: Intermediate
Platform: Ninja 7, TOS
Favorite Futures: YM, ES, GC, CL
 
DougN's Avatar
 
Posts: 37 since Nov 2013
Thanks: 28 given, 28 received


ABCTG View Post
DougN,

if you open the code in the editor and try to verify it, it will probably give you an error. What is the error message and can you post the code?

Regards,
ABCTG

Much obliged ABCTG...heres the code as it was copied and pasted from a thread here in the forum...


(TradeStation Forums)

[LegacyColorValue = true];

Inputs: iRangeLengthMin(30),

iBrakePoints(1),

iEntryTimeLimit(-90),

iContracts(1),

iProfitTarget(500),

Price(Close),

Length(12) ,



Var: OpenRangeTime(CalcTime(SessionStartTime(0,1), iRangeLengthMin)),

EntryTimeLimit(CalcTime(SessionEndTime(0,1), iEntryTimeLimit)),

RangeH(0),RangeL(0), // H&L of range

TimeH(0), TimeL(0), // time of H&L

RangeHtime(0), RangeLtime(0),

vDollarStop(500),

FirstTrade(true),

CustomCond(true),

Cond4trade(true),

vVolumeLenght(7),

ExpAvg(0),

firstcheck(true),

MaxP(0)

DateInFromTo(false);



// New day settings

if Date<>Date[1] then begin

//DateInFromTo= (Date>=iFromYYYMMDD and Date<=iToYYYMMDD);

FirstTrade=true;

RangeH=H; RangeL=L; // first bars High Low are Ranges h&l

TimeH=Time; TimeL=Time;

end;



// Range settings

If L<LowD(0)[1] then TimeL=Time; {if new H or L, remember the time of H or L}

If H>HighD(0)[1] then TimeH=Time;



If Time=OpenRangeTime then begin // if openning range is finished

RangeH=HighD(0);

RangeL=LowD(0);

RangeHtime=TimeH;

RangeLtime=TimeL;

end; // remember Range parameters



// ***************** Trade ******************

CustomCond= true;

Cond4trade = CustomCond and time>OpenRangeTime and time<EntryTimeLimit ; //and DateInFromTo



If Cond4Trade then begin

If FirstTrade and Close>=RangeH then

begin

Buy("BrOR_L1") iContracts contracts Next bar at open;

FirstTrade=false;

end;

If FirstTrade and Close<=RangeL then

begin

sellshort("RrOR_Sh1") iContracts contracts next bar at open;

FirstTrade=false;

end;

end;

SetStopContract;

SetStopLoss(100);

SetProfitTarget(100);



// ******************** Plots and Text ********************

Vars: Decimals($DecOfPriceScale),

PLot_hi(0),Plot_lo(0),

Low_line(-1),OR_Bar(-1),Hi_Line(-1),

Hi_text(-1),Lo_text(-1);



if time = OpenRangeTime then begin

Plot_hi = HighD(0);

Plot_lo = LowD(0);



{Draw Lines}

Hi_line = TL_new(date,time,Plot_hi,date,SessionEndTime(0,1),Plot_hi);

Tl_setstyle(Hi_line,tool_dashed2);

Tl_setcolor(Hi_line, yellow);

Low_line = TL_new(date,time,Plot_lo,Date,SessionEndTime(0,1),Plot_lo);

Tl_setstyle(Low_line,tool_dashed2);

Tl_setcolor(Low_line,yellow );

OR_bar = TL_new(date,time,Plot_hi,date,time,plot_lo);

TL_setcolor(OR_bar,lightgray);

{Text}

if ShowText then begin

Hi_text = Text_new(Date,SessionStartTime(0,1) ,Plot_hi ,numtostr(Plot_hi,decimals));

Lo_text = Text_new(Date,SessionStartTime(0,1),Plot_lo ,numtostr(Plot_lo,decimals));

end;

end;


and this is what shows in the indicator list...2014-01-31_0640 - donzidoug's library

and here is what I could find for errors...2014-01-31_0645 - donzidoug's library

Reply With Quote
 
  #7 (permalink)
Market Wizard
Hamburg Germany
 
Futures Experience: Advanced
Platform: Multicharts, Tradestation, Multicharts.NET, NinjaTrader, MetaTrader
Broker/Data: DTN IQ
Favorite Futures: ES
 
Posts: 1,524 since Apr 2013
Thanks: 229 given, 852 received
Forum Reputation: Legendary

DougN,

I didn't check the code below, but it compiles now. It was missing one semicolon, a comma, an input and I changed
the decimals variable (which I believe was coming from a function before).

Regards,
ABCTG

 
Code
Inputs: iRangeLengthMin(30),

iBrakePoints(1),

iEntryTimeLimit(-90),

iContracts(1),

iProfitTarget(500),

Price(Close),

Length(12),
ShowText (true);



Var: OpenRangeTime(CalcTime(SessionStartTime(0,1), iRangeLengthMin)),

EntryTimeLimit(CalcTime(SessionEndTime(0,1), iEntryTimeLimit)),

RangeH(0),RangeL(0), // H&L of range

TimeH(0), TimeL(0), // time of H&L

RangeHtime(0), RangeLtime(0),

vDollarStop(500),

FirstTrade(true),

CustomCond(true),

Cond4trade(true),

vVolumeLenght(7),

ExpAvg(0),

firstcheck(true),

MaxP(0),

DateInFromTo(false);



// New day settings

if Date<>Date[1] then begin

//DateInFromTo= (Date>=iFromYYYMMDD and Date<=iToYYYMMDD);

FirstTrade=true;

RangeH=H; RangeL=L; // first bars High Low are Ranges h&l

TimeH=Time; TimeL=Time;

end;



// Range settings

If L<LowD(0)[1] then TimeL=Time; {if new H or L, remember the time of H or L}

If H>HighD(0)[1] then TimeH=Time;



If Time=OpenRangeTime then begin // if openning range is finished

RangeH=HighD(0);

RangeL=LowD(0);

RangeHtime=TimeH;

RangeLtime=TimeL;

end; // remember Range parameters



// ***************** Trade ******************

CustomCond= true;

Cond4trade = CustomCond and time>OpenRangeTime and time<EntryTimeLimit ; //and DateInFromTo



If Cond4Trade then begin

If FirstTrade and Close>=RangeH then

begin

Buy("BrOR_L1") iContracts contracts Next bar at open;

FirstTrade=false;

end;

If FirstTrade and Close<=RangeL then

begin

sellshort("RrOR_Sh1") iContracts contracts next bar at open;

FirstTrade=false;

end;

end;

SetStopContract;

SetStopLoss(100);

SetProfitTarget(100);



// ******************** Plots and Text ********************

Vars: Decimals(Log(PriceScale)/ Log(10)),

PLot_hi(0),Plot_lo(0),

Low_line(-1),OR_Bar(-1),Hi_Line(-1),

Hi_text(-1),Lo_text(-1);



if time = OpenRangeTime then begin

Plot_hi = HighD(0);

Plot_lo = LowD(0);



{Draw Lines}

Hi_line = TL_new(date,time,Plot_hi,date,SessionEndTime(0,1),Plot_hi);

Tl_setstyle(Hi_line,tool_dashed2);

Tl_setcolor(Hi_line, yellow);

Low_line = TL_new(date,time,Plot_lo,Date,SessionEndTime(0,1),Plot_lo);

Tl_setstyle(Low_line,tool_dashed2);

Tl_setcolor(Low_line,yellow );

OR_bar = TL_new(date,time,Plot_hi,date,time,plot_lo);

TL_setcolor(OR_bar,lightgray);

{Text}

if ShowText then begin

Hi_text = Text_new(Date,SessionStartTime(0,1) ,Plot_hi ,numtostr(Plot_hi,decimals));

Lo_text = Text_new(Date,SessionStartTime(0,1),Plot_lo ,numtostr(Plot_lo,decimals));

end;

end;

Reply With Quote
The following user says Thank You to ABCTG for this post:
 
  #8 (permalink)
Elite Member
Scottsdale, Arizona, USA and Puerto Penasco, Mx
 
Futures Experience: Intermediate
Platform: Ninja 7, TOS
Favorite Futures: YM, ES, GC, CL
 
DougN's Avatar
 
Posts: 37 since Nov 2013
Thanks: 28 given, 28 received

This is my first year with Tradestation but I have successfully installed other indicators before trying these. As shown below all three of the indicators that I have attempted to install from Mikes will not verify for some reason. This includes what you posted above. In the screenshot below yours is the one labeled OpenRange2.

2014-01-31_1634 - donzidoug's library

Certainly there is something wrong on my end...just not sure what I'm screwing up.

Tried again with the code above that worked for you and heres the result...
http://screencast.com/t/jqohW3gmgjD


Last edited by DougN; January 31st, 2014 at 07:44 PM. Reason: new info added
Reply With Quote
 
  #9 (permalink)
Market Wizard
Hamburg Germany
 
Futures Experience: Advanced
Platform: Multicharts, Tradestation, Multicharts.NET, NinjaTrader, MetaTrader
Broker/Data: DTN IQ
Favorite Futures: ES
 
Posts: 1,524 since Apr 2013
Thanks: 229 given, 852 received
Forum Reputation: Legendary

DougN,

the code you posted is for a strategy and contains reserved words that Tradestation doesn't allow in indicators. From your screenshot it appears that you created an indicator and this won't verify and give you the errors you receive.
Try creating a new strategy and paste the code in there. This should work for you.

Regards,
ABCTG

Reply With Quote
The following user says Thank You to ABCTG for this post:
 
  #10 (permalink)
Elite Member
Scottsdale, Arizona, USA and Puerto Penasco, Mx
 
Futures Experience: Intermediate
Platform: Ninja 7, TOS
Favorite Futures: YM, ES, GC, CL
 
DougN's Avatar
 
Posts: 37 since Nov 2013
Thanks: 28 given, 28 received


Sorry but the result was the same creating these as strategies. Obviously I am doing something wrong but just have no idea what it is. If someone else is using these perhaps they could share the actual Tradestation workspace? This could allow the chance to see their functioning indicators and compare them with mine that will not verify.

Reply With Quote

Reply



futures io > > > > > Opening Range Breakout

Thread Tools Search this Thread
Search this Thread:

Advanced Search



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

Linda Bradford Raschke: Reading The Tape

Elite only

Adam Grimes: TBA

Elite only

NinjaTrader: TBA

January

Ran Aroussi: TBA

Elite only
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
Open Range Breakout seveneigthtsix NinjaTrader Programming 11 September 1st, 2017 11:46 AM
Opening Range Breakout (EasyLanguage, automated) Big Mike Elite EasyLanguage Automated Trading 48 October 4th, 2016 06:49 PM
Range breakout indicator Jeff Castille NinjaTrader 16 April 23rd, 2012 03:11 PM
Opening Range of 6E supermht Currency Futures 4 April 8th, 2012 08:05 PM
Opening Range Indicator msocks The Elite Circle 0 September 16th, 2009 12:58 AM


All times are GMT -4. The time now is 11:54 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-10 in 0.13 seconds with 20 queries on phoenix via your IP 54.90.207.75