NexusFi: Find Your Edge


Home Menu

 





reference future data in EasyLanguage?


Discussion in EasyLanguage Programming

Updated
      Top Posters
    1. looks_one Big Mike with 3 posts (4 thanks)
    2. looks_two shzhning with 3 posts (0 thanks)
    3. looks_3 Quick Summary with 1 posts (0 thanks)
    4. looks_4 BDawg with 1 posts (0 thanks)
    1. trending_up 6,764 views
    2. thumb_up 5 thanks given
    3. group 4 followers
    1. forum 9 posts
    2. attach_file 0 attachments




 
Search this Thread

reference future data in EasyLanguage?

(login for full post details)
  #1 (permalink)
 shzhning 
Madison, NJ
 
Experience: Intermediate
Platform: CQG/TOS
Broker: Optimus/CQG
Trading: ZN/TN/ES/NQ
Posts: 134 since Jun 2010
Thanks Given: 65
Thanks Received: 112

Hi I'm new to this forum, and this is going to be my first post.

Here's my question: I know you can reference historical data by using "[1]" (1 bar ago), but is it allowed to reference future data using "[-1]" (1 bar ahead)?

I'm asking this question because I'm working on a study that calls for identifying the highest/lowest price within a range of 5 bars, i.e. current bar, 2 bars before current bar, and 2 bars after current bar.

Thanks in advance!

Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
ISO Equity Curve Indicator
NinjaTrader
Volume profile TradeStation
EasyLanguage Programming
The space time continuum and the dynamics of a financial …
Emini and Emicro Index
Request for MACD with option to use different MAs for fa …
NinjaTrader
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
GFIs1 1 DAX trade per day journal
28 thanks
Supertradersams Thread Journal on NQ/MNQ
26 thanks
Tao te Trade: way of the WLD
24 thanks
Just another trading journal: PA, Wyckoff & Trends
12 thanks
1% Risk Journal
11 thanks

(login for full post details)
  #3 (permalink)
 
Big Mike's Avatar
 Big Mike 
Manta, Ecuador
Site Administrator
Developer
Swing Trader
 
Experience: Advanced
Platform: Custom solution
Broker: IBKR
Trading: Stocks & Futures
Posts: 50,232 since Jun 2009
Thanks Given: 33,103
Thanks Received: 101,344



shzhning View Post
Hi I'm new to this forum, and this is going to be my first post.

Here's my question: I know you can reference historical data by using "[1]" (1 bar ago), but is it allowed to reference future data using "[-1]" (1 bar ahead)?

I'm asking this question because I'm working on a study that calls for identifying the highest/lowest price within a range of 5 bars, i.e. current bar, 2 bars before current bar, and 2 bars after current bar.

Thanks in advance!

There is no such thing as "after the current bar". Not unless you are trading from your Delorian going 88mph:



Mike

We're here to help: just ask the community or contact our Help Desk

Quick Links: Change your Username or Register as a Vendor


For the best trading education, watch our webinars
Searching for trading reviews? Review this list


Lifetime Elite Membership: Sign-up for only $149 USD
Receive exclusive offers from our Site Sponsors: Browse Offers
Report problems with the site: Using the NexusFi changelog thread
Follow me on Twitter Visit my NexusFi Trade Journal Reply With Quote
The following 3 users say Thank You to Big Mike for this post:
(login for full post details)
  #4 (permalink)
 
Big Mike's Avatar
 Big Mike 
Manta, Ecuador
Site Administrator
Developer
Swing Trader
 
Experience: Advanced
Platform: Custom solution
Broker: IBKR
Trading: Stocks & Futures
Posts: 50,232 since Jun 2009
Thanks Given: 33,103
Thanks Received: 101,344


shzhning View Post
I'm asking this question because I'm working on a study that calls for identifying the highest/lowest price within a range of 5 bars, i.e. current bar, 2 bars before current bar, and 2 bars after current bar.

If you want to know the High or Low of the last 5 bars:

 
Code
                            
vars:

  
myH (0),
  
myL (0);

myH Highest(H5);
myL Lowest(L5); 
If you need something more advanced you'll need to explain more in depth your process so someone can help.

Mike

We're here to help: just ask the community or contact our Help Desk

Quick Links: Change your Username or Register as a Vendor


For the best trading education, watch our webinars
Searching for trading reviews? Review this list


Lifetime Elite Membership: Sign-up for only $149 USD
Receive exclusive offers from our Site Sponsors: Browse Offers
Report problems with the site: Using the NexusFi changelog thread
Follow me on Twitter Visit my NexusFi Trade Journal Reply With Quote
The following user says Thank You to Big Mike for this post:
(login for full post details)
  #5 (permalink)
 shzhning 
Madison, NJ
 
Experience: Intermediate
Platform: CQG/TOS
Broker: Optimus/CQG
Trading: ZN/TN/ES/NQ
Posts: 134 since Jun 2010
Thanks Given: 65
Thanks Received: 112

Thanks Mike!

But this is not exactly what I'm looking for. Let me do a better job explaining my idea:

1) I would first look for the highest/lowest point within 3 bars, i.e. current bar and previous 2 bars.
2) Then I would wait for the next 2 bars to confirm. If the next 2 bars do not break through the previous range, then the range holds. If the next 2 bars do break through the previous range, then range would adapt dynamically.

I'm new to EasyLanguage and not sure if it's feasible in MultiCharts/TradeStation.

Thanks again!

Started this thread Reply With Quote
(login for full post details)
  #6 (permalink)
 
Big Mike's Avatar
 Big Mike 
Manta, Ecuador
Site Administrator
Developer
Swing Trader
 
Experience: Advanced
Platform: Custom solution
Broker: IBKR
Trading: Stocks & Futures
Posts: 50,232 since Jun 2009
Thanks Given: 33,103
Thanks Received: 101,344


shzhning View Post
Thanks Mike!

But this is not exactly what I'm looking for. Let me do a better job explaining my idea:

1) I would first look for the highest/lowest point within 3 bars, i.e. current bar and previous 2 bars.

 
Code
                            
vars
  
myH (0), 
  
myL (0); 

myH Highest(H3); 
myL Lowest(L3); 

shzhning View Post
2) Then I would wait for the next 2 bars to confirm. If the next 2 bars do not break through the previous range, then the range holds. If the next 2 bars do break through the previous range, then range would adapt dynamically.


 
Code
                            
vars
  
myH (0),
  
myHbar (0),
  
myL (0),
  
myLbar (0);

if 
myH and myHbar <= 2 then begin

  myHbar 
0;
  
myH Highest(HmyHbar);

else

 
myHbar += 1;

end;

if 
myL and myLbar <= 2 then begin

  myLbar 
0;
  
myL Lowest(LmyLbar);

else

 
myLbar += 1;

end;

myH Highest(HmyHbar); 
myL Lowest(LmyLbar); 

shzhning View Post
I'm new to EasyLanguage and not sure if it's feasible in MultiCharts/TradeStation.

Just about anything is possible. Try the above code, I just wrote it free hand so it may need some work and probably a good amount of refinement for your exact needs, but I think you get the general idea.

Mike

We're here to help: just ask the community or contact our Help Desk

Quick Links: Change your Username or Register as a Vendor


For the best trading education, watch our webinars
Searching for trading reviews? Review this list


Lifetime Elite Membership: Sign-up for only $149 USD
Receive exclusive offers from our Site Sponsors: Browse Offers
Report problems with the site: Using the NexusFi changelog thread
Follow me on Twitter Visit my NexusFi Trade Journal Reply With Quote
(login for full post details)
  #7 (permalink)
 shzhning 
Madison, NJ
 
Experience: Intermediate
Platform: CQG/TOS
Broker: Optimus/CQG
Trading: ZN/TN/ES/NQ
Posts: 134 since Jun 2010
Thanks Given: 65
Thanks Received: 112

Thanks Mike! That's really helpful.

FYI, here's what I had in mind (hence my original question):
For high point: MaxList(high[2],high[1],high[0],high[-1],high[-2])
For low point:
MinList(low[2],low[1],low[0],low[-1],low[-2])



Started this thread Reply With Quote
(login for full post details)
  #8 (permalink)
 
BDawg's Avatar
 BDawg 
Seattle, WA
 
Experience: Advanced
Platform: Tradestation, C#
Broker: Tradestation,TD,Tradier
Trading: Options, ETFs, VIX, Indices
Posts: 15 since Oct 2010
Thanks Given: 64
Thanks Received: 11

Trying to access a bar that hasn't happened yet is impossible.


That's why H[-1] doesn't work. It's in the future, so you don't know what it will be (unless you have the Delorean with the flux capacitor as stated above).

Here's a system that would work great because it knows whether to buy or sell short today and at what price, as well as what price to close the trade on tomorrow:

 
Code
if (H[-1] - L[0] > H[0] - L[-1]) then begin
    buy 100000 contracts at L[0] limit;
    sell 100000 contracts next bar at H[-1] limit;
end
else begin
    sell short 100000 contracts at H[0] limit;
    buy to cover 100000 contracts next bar at L[-1] limit;
end;
I wish my computer knew what the prices are gonna be for the next day or two, but unfortunately, it doesn't.

Reply With Quote
(login for full post details)
  #9 (permalink)
sunbeam
Sydney Australia
 
Posts: 3 since Jan 2012
Thanks Given: 0
Thanks Received: 1

"I wish my computer knew what the prices are gonna be for the next day or two, but unfortunately, it doesn't."

Sorry for re-activating an old post but am new to MC and thought that you may not be aware that you can call up future bars/prices in Easylanguage. It is a dll called AnyOHLC.dll. However one needs to be very careful in applying it in signals!

Reply With Quote
The following user says Thank You to sunbeam for this post:
(login for full post details)
  #10 (permalink)
 simon007 
Den Haag
 
Experience: Intermediate
Platform: Multicharts
Trading: Silver
Posts: 1 since Mar 2011
Thanks Given: 0
Thanks Received: 0



sunbeam View Post
"I wish my computer knew what the prices are gonna be for the next day or two, but unfortunately, it doesn't."

Sorry for re-activating an old post but am new to MC and thought that you may not be aware that you can call up future bars/prices in Easylanguage. It is a dll called AnyOHLC.dll. However one needs to be very careful in applying it in signals!

Does anybody know where one can get AnyOHLC.dll?

Best regards,

Simon

Reply With Quote





Last Updated on October 4, 2012


© 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