reference future data in EasyLanguage? - futures io
futures io futures trading



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 5,597 views
    2. thumb_up 5 thanks given
    3. group 4 followers
    1. forum 9 posts
    2. attach_file 0 attachments




Welcome to futures io: the largest futures trading community on the planet, with well over 125,000 members
  • Genuine reviews from real traders, not fake reviews from stealth vendors
  • Quality education from leading professional traders
  • We are a friendly, helpful, and positive community
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts
  • We are here to help, just let us know what you need
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

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

 
Search this Thread
 

reference future data in EasyLanguage?

(login for full post details)
  #1 (permalink)
Madison, NJ
 
Experience: Intermediate
Platform: CQG/TOS
Broker: Optimus/CQG
Trading: ZN/TN/ES/NQ
 
Posts: 131 since Jun 2010
Thanks: 60 given, 106 received

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

Journal Challenge February 2021 results:
Competing for $1500 in prizes from Topstep
looks_oneSBtrader82 's Trading Journalby SBtrader82
(173 thanks from 31 posts)
looks_twoJust BEING a Trader: Letting Go!!by iqgod
(120 thanks from 33 posts)
looks_3Wisdom is Emptinessby Mtype
(68 thanks from 25 posts)
looks_4Deetee’s DAX Trading Journal (time based)by Deetee
(35 thanks from 17 posts)
looks_5Journal for peanuts1956by peanuts1956
(23 thanks from 13 posts)
 
 
(login for full post details)
  #3 (permalink)
Site Administrator
Swing Trader
Data Scientist & DevOps
Manta, Ecuador
 
Experience: Advanced
Platform: My own custom solution
Trading: Emini Futures
 
Big Mike's Avatar
 
Posts: 49,765 since Jun 2009
Thanks: 32,302 given, 97,542 received



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

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

Follow us on Twitter, YouTube, and Facebook

Support our community as an Elite Member:
https://futures.io/elite/
Follow me on Twitter Visit my futures io 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)
Site Administrator
Swing Trader
Data Scientist & DevOps
Manta, Ecuador
 
Experience: Advanced
Platform: My own custom solution
Trading: Emini Futures
 
Big Mike's Avatar
 
Posts: 49,765 since Jun 2009
Thanks: 32,302 given, 97,542 received


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

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

Follow us on Twitter, YouTube, and Facebook

Support our community as an Elite Member:
https://futures.io/elite/
Follow me on Twitter Visit my futures io Trade Journal Reply With Quote
The following user says Thank You to Big Mike for this post:
 
(login for full post details)
  #5 (permalink)
Madison, NJ
 
Experience: Intermediate
Platform: CQG/TOS
Broker: Optimus/CQG
Trading: ZN/TN/ES/NQ
 
Posts: 131 since Jun 2010
Thanks: 60 given, 106 received

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)
Site Administrator
Swing Trader
Data Scientist & DevOps
Manta, Ecuador
 
Experience: Advanced
Platform: My own custom solution
Trading: Emini Futures
 
Big Mike's Avatar
 
Posts: 49,765 since Jun 2009
Thanks: 32,302 given, 97,542 received


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

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

Follow us on Twitter, YouTube, and Facebook

Support our community as an Elite Member:
https://futures.io/elite/
Follow me on Twitter Visit my futures io Trade Journal Reply With Quote
 
(login for full post details)
  #7 (permalink)
Madison, NJ
 
Experience: Intermediate
Platform: CQG/TOS
Broker: Optimus/CQG
Trading: ZN/TN/ES/NQ
 
Posts: 131 since Jun 2010
Thanks: 60 given, 106 received

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)
Seattle, WA
 
Experience: Advanced
Platform: Tradestation, C#
Broker: Tradestation,TD,Tradier
Trading: Options, ETFs, VIX, Indices
 
BDawg's Avatar
 
Posts: 15 since Oct 2010
Thanks: 64 given, 11 received

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)
Sydney Australia
 
 
Posts: 3 since Jan 2012
Thanks: 0 given, 1 received

"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)
Den Haag
 
Experience: Intermediate
Platform: Multicharts
Trading: Silver
 
Posts: 1 since Mar 2011
Thanks: 0 given, 0 received



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


futures io Trading Community Platforms and Indicators EasyLanguage Programming > reference future data in EasyLanguage?


Last Updated on October 4, 2012


Upcoming Webinars and Events
 

NinjaTrader Indicator Challenge!

Ongoing
 

Battlestations! Show us your trading desk - $1,500 in prizes!

March
 

Call Option Buying: The New Pain Trade? w/Carley Garner

Elite only
 

Importance of Finding Your Own Way w/Adam Grimes

Elite only
 

New Challenge (TBD)

April
     



Copyright © 2021 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