NexusFi: Find Your Edge


Home Menu

 





ORB Thinkorswim code for TradeStation 10


Discussion in Traders Hideout

Updated
      Top Posters
    1. looks_one lrc11239 with 19 posts (0 thanks)
    2. looks_two numberjuani with 17 posts (2 thanks)
    3. looks_3 ilalovely with 7 posts (1 thanks)
    4. looks_4 kevinkdog with 5 posts (0 thanks)
    1. trending_up 11,399 views
    2. thumb_up 3 thanks given
    3. group 7 followers
    1. forum 53 posts
    2. attach_file 7 attachments




 
 

ORB Thinkorswim code for TradeStation 10

 
 
numberjuani's Avatar
 numberjuani 
Agoura Hills, CA USA
 
Experience: Advanced
Platform: Tradestation&Multicharts
Broker: TradeStation
Trading: Futures & Equities
Posts: 128 since Apr 2019
Thanks Given: 9
Thanks Received: 102

Ok I’ll try it tomorrow... so help me understand this strategy a bit... you enter the trade on either direction it breaks the range? How wide a stop? When do you close?


Can you help answer these questions
from other members on NexusFi?
New Micros: Ultra 10-Year & Ultra T-Bond -- Live Now
Treasury Notes and Bonds
ZombieSqueeze
Platforms and Indicators
Futures True Range Report
The Elite Circle
Are there any eval firms that allow you to sink to your …
Traders Hideout
My NT8 Volume Profile Split by Asian/Euro/Open
NinjaTrader
 
 
lrc11239
Brooklyn NY USA
 
Posts: 27 since Jul 2019
Thanks Given: 2
Thanks Received: 0


numberjuani View Post
Ok I’ll try it tomorrow... so help me understand this strategy a bit... you enter the trade on either direction it breaks the range? How wide a stop? When do you close?



Yes. My stop is the other side of the range. I use the first 30 seconds range for crude, NQ Gold and ES futures. My targets are different for each instrument.


Sent using the NexusFi mobile app

 
 
numberjuani's Avatar
 numberjuani 
Agoura Hills, CA USA
 
Experience: Advanced
Platform: Tradestation&Multicharts
Broker: TradeStation
Trading: Futures & Equities
Posts: 128 since Apr 2019
Thanks Given: 9
Thanks Received: 102



lrc11239 View Post
Yes. My stop is the other side of the range. I use the first 30 seconds range for crude, NQ Gold and ES futures. My targets are different for each instrument.


Sent using the NexusFi mobile app

got it
Make sure to click Settings - > Window -> Space to the right. It'll plot into the future by as many bars as you specify there, as per this image


Inputs:
SessionStart(630),
RangeDurationBars(1),
Targets(10);


Variables:
FirstBar(0),
LastBar(0),
Period(0),
BreakoutTop(0),
BreakoutBottom(0);


if time = SessionStart then begin
LastBar = BarNumber[1];
Period = LastBar - FirstBar;
FirstBar = CurrentBar;
Print(Period);
end;

If BarNumber = FirstBar + (RangeDurationBars -1) then begin
BreakoutTop = Highest(H, CurrentBar - FirstBar + 1);
Breakoutbottom = Lowest(L, CurrentBar - FirstBar + 1);
end;

Plot1(BreakoutTop, "OpeningRangeTop");
Plot2(Breakoutbottom, "OpeningRangeBottom");
Plot3(BreakoutTop + Targets, "LE_Target");
Plot4(Breakoutbottom - Targets, "SE_Target");



If LastBaronChart then begin
Plot1[-MaxBarsForward](BreakoutTop, "OpeningRangeTop");
Plot2[-MaxBarsForward](Breakoutbottom, "OpeningRangeBottom");
Plot3[-MaxBarsForward](BreakoutTop + Targets, "LE_Target");
Plot4[-MaxBarsForward](Breakoutbottom - Targets, "SE_Target");
end;


If CurrentBar = FirstBar + Period or CurrentBar = (FirstBar + (RangeDurationBars -1 )) or FirstBar = CurrentBar then begin
SetPlotColor(1, Transparent);
SetPlotColor(2, Transparent);
SetPlotColor(3, Transparent);
SetPlotColor(4, Transparent);
end;

Attached Thumbnails
Click image for larger version

Name:	Screenshot (37).png
Views:	404
Size:	116.8 KB
ID:	275048   Click image for larger version

Name:	Screenshot (38).png
Views:	358
Size:	147.1 KB
ID:	275051  
Thanked by:
 
lrc11239
Brooklyn NY USA
 
Posts: 27 since Jul 2019
Thanks Given: 2
Thanks Received: 0

Thank you! You are the man! I'm going to try it and let you know if everything is fine. Thanks again!

 
 
mistershake's Avatar
 mistershake 
Rome - Italy
 
Experience: Advanced
Platform: NinjaTrader
Trading: Bund, DAX, ES, Crude Oil, Gold, Cable, EURUSD
Posts: 10 since Apr 2016
Thanks Given: 11
Thanks Received: 3

Hi numberjuani , could you code it also for NT8 ?




numberjuani View Post
got it
Make sure to click Settings - > Window -> Space to the right. It'll plot into the future by as many bars as you specify there, as per this image


Inputs:
SessionStart(630),
RangeDurationBars(1),
Targets(10);


Variables:
FirstBar(0),
LastBar(0),
Period(0),
BreakoutTop(0),
BreakoutBottom(0);


if time = SessionStart then begin
LastBar = BarNumber[1];
Period = LastBar - FirstBar;
FirstBar = CurrentBar;
Print(Period);
end;

If BarNumber = FirstBar + (RangeDurationBars -1) then begin
BreakoutTop = Highest(H, CurrentBar - FirstBar + 1);
Breakoutbottom = Lowest(L, CurrentBar - FirstBar + 1);
end;

Plot1(BreakoutTop, "OpeningRangeTop");
Plot2(Breakoutbottom, "OpeningRangeBottom");
Plot3(BreakoutTop + Targets, "LE_Target");
Plot4(Breakoutbottom - Targets, "SE_Target");



If LastBaronChart then begin
Plot1[-MaxBarsForward](BreakoutTop, "OpeningRangeTop");
Plot2[-MaxBarsForward](Breakoutbottom, "OpeningRangeBottom");
Plot3[-MaxBarsForward](BreakoutTop + Targets, "LE_Target");
Plot4[-MaxBarsForward](Breakoutbottom - Targets, "SE_Target");
end;


If CurrentBar = FirstBar + Period or CurrentBar = (FirstBar + (RangeDurationBars -1 )) or FirstBar = CurrentBar then begin
SetPlotColor(1, Transparent);
SetPlotColor(2, Transparent);
SetPlotColor(3, Transparent);
SetPlotColor(4, Transparent);
end;


 
 
numberjuani's Avatar
 numberjuani 
Agoura Hills, CA USA
 
Experience: Advanced
Platform: Tradestation&Multicharts
Broker: TradeStation
Trading: Futures & Equities
Posts: 128 since Apr 2019
Thanks Given: 9
Thanks Received: 102


mistershake View Post
Hi numberjuani , could you code it also for NT8 ?

Sorry amico I only know how to code for Tradestation or Multicharts

 
 
mistershake's Avatar
 mistershake 
Rome - Italy
 
Experience: Advanced
Platform: NinjaTrader
Trading: Bund, DAX, ES, Crude Oil, Gold, Cable, EURUSD
Posts: 10 since Apr 2016
Thanks Given: 11
Thanks Received: 3

Is it possible to have the Multicharts code then ?

Thanks amico


numberjuani View Post
Sorry amico I only know how to code for Tradestation or Multicharts


 
 
numberjuani's Avatar
 numberjuani 
Agoura Hills, CA USA
 
Experience: Advanced
Platform: Tradestation&Multicharts
Broker: TradeStation
Trading: Futures & Equities
Posts: 128 since Apr 2019
Thanks Given: 9
Thanks Received: 102


mistershake View Post
Is it possible to have the Multicharts code then ?



Thanks amico



It’s the same, both MC and TS use easy language, so that same code should work in MC


Sent using the NexusFi mobile app

 
 
Angler's Avatar
 Angler 
Winter Park, FL
 
Experience: Advanced
Platform: TS,CQG,Oec,ATP,TOS
Broker: TS,Fidelity,CQG
Trading: ES,RTY,FX
Posts: 30 since Mar 2011
Thanks Given: 15
Thanks Received: 9

Hello,

What would be settings if the ORB was set to 5 minutes? Thank you

Kr

"Yeah, well, you know, that's your opinion, man..."
 
ilalovely
South Daytona
 
Posts: 10 since Mar 2021
Thanks Given: 1
Thanks Received: 1


Hi I know this is old but found this while looking for the orb strategy for tradestation. Just moved over. It is givibg me an error for the start time of 630. I am eastern so tried changing it to 930 but still having an error. Any ideas? Thanks in advance.



numberjuani View Post
So you have to put it on a 30 sec chart, the way easy language treats seconds is a bit weird, but i think its working:

Inputs:
SessionStart(630),
RangeDurationBars(1),
StopValue(2000),
TargetValue(3000),
CloseEndOfday(True);


Variables:
FirstBar(0),
LastBar(0),
Period(0),
BreakoutTop(0),
BreakoutBottom(0);


if time = SessionStart then begin
LastBar = BarNumber[1];
Period = LastBar - FirstBar;
FirstBar = CurrentBar;
Print(Period);
end;

If BarNumber = FirstBar + (RangeDurationBars -1) then begin
BreakoutTop = Highest(H, CurrentBar - FirstBar + 1);
Breakoutbottom = Lowest(L, CurrentBar - FirstBar + 1);
end;


If BarNumber = FirstBar + (RangeDurationBars) then begin
Buy Next Bar BreakOutTop Stop;
Sellshort Next Bar BreakOutBottom Stop;
end;

If CloseendOfDay and CurrentBar = FirstBar + Period - 1 then begin
Sell next bar market;
Buy to cover next bar market;
end;

SetStopContract;
SetStopLoss(StopValue);
SetProfitTarget(TargetValue);

as an indicator: once again 30 sec chart

Inputs:
SessionStart(630),
RangeDurationBars(1);


Variables:
FirstBar(0),
LastBar(0),
Period(0),
BreakoutTop(0),
BreakoutBottom(0);


if time = SessionStart then begin
LastBar = BarNumber[1];
Period = LastBar - FirstBar;
FirstBar = CurrentBar;
Print(Period);
end;

If BarNumber = FirstBar + (RangeDurationBars -1) then begin
BreakoutTop = Highest(H, CurrentBar - FirstBar + 1);
Breakoutbottom = Lowest(L, CurrentBar - FirstBar + 1);
end;


Plot1(BreakoutTop, "OpeningRangeTop");
Plot2(Breakoutbottom, "OpeningRangeBottom");


If CurrentBar = FirstBar + Period or CurrentBar = (FirstBar + (RangeDurationBars -1 )) or FirstBar = CurrentBar then begin
SetPlotColor(1, Transparent);
SetPlotColor(2, Transparent);
end;


Thanked by:

 



Last Updated on November 6, 2023


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
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.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts