Help with understanding EL bar references - futures io
futures io



Help with understanding EL bar references


Discussion in EasyLanguage Programming

Updated
    1. trending_up 3,439 views
    2. thumb_up 2 thanks given
    3. group 1 followers
    1. forum 1 posts
    2. attach_file 2 attachments




Welcome to futures io: the largest futures trading community on the planet, with well over 150,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
 

Help with understanding EL bar references

(login for full post details)
  #1 (permalink)
oldhickory
Honolulu, HI
 
 
Posts: 1 since Jan 2022
Thanks: 1 given, 0 received

Hello,

I need some help understanding how to reference previous bars within EL. I am working on a strategy that trades based on if the previous bar was an outside bar.

Entry:
 
Code
[IntrabarOrderGeneration = false]

if OutsideBar( High, Low ) and Close > Open then
	Buy ( !( "OutBarLE" ) ) next bar at High limit;
Exit:
 
Code
[IntrabarOrderGeneration = true]

if MarketPosition <> 0 then
	Sell ( "Exit Name" ) next bar at EntryPrice + 0.10 limit ;
The problem is when I go to set the price for my limit order it does not reference the high of the previous bar (the outside bar) but rather the high of the current bar (which just ends up being the open). When I attempt to use High[1] to reference the previous bar it references the bar behind the outside bar. I've attached screenshots for more detail.

Obviously there is something I'm not understanding about how bars are referenced. If someone is willing to enlighten me I would appreciate it.

Attached Thumbnails
Click image for larger version

Name:	OBLEHigh.png
Views:	52
Size:	56.4 KB
ID:	321802   Click image for larger version

Name:	OBLEHigh1.png
Views:	53
Size:	58.4 KB
ID:	321803  
Reply With Quote

Can you help answer these questions
from other members on futures io?
Market on Close data within IB
Platforms and Indicators
How do I create Strategy with the Second Entry indicator
NinjaTrader
NT8 Order Management Strategy
The Elite Circle
in depth understanding of last, bid, and ask volume in c …
NinjaTrader
Big Mo Indicator for NT8
NinjaTrader
 
 
(login for full post details)
  #2 (permalink)
 kevinkdog   is a Vendor
 
 
Posts: 3,465 since Jul 2012
Thanks: 1,827 given, 6,985 received


oldhickory View Post
Hello,

I need some help understanding how to reference previous bars within EL. I am working on a strategy that trades based on if the previous bar was an outside bar.

Entry:
 
Code
[IntrabarOrderGeneration = false]

if OutsideBar( High, Low ) and Close > Open then
	Buy ( !( "OutBarLE" ) ) next bar at High limit;

What you are doing here is evaluating the CURRENT bar to see if it is an outside bar. And you want to see if the bar before this one is an outside bar, right?

Couple ways to do it, I'd do it this way (easiest way to read):

 
Code
var:obBar(False);

obBar=OutsideBar(High,Low) ;  //ObBar will be true if this bar is outside bar, false if not

if ObBar[1] and Close > Open then  //is previous bar an outside bar?
	Buy ( !( "OutBarLE" ) ) next bar at High limit;

Follow me on Twitter Reply With Quote
The following 2 users say Thank You to kevinkdog for this post:


futures io Trading Community Platforms and Indicators EasyLanguage Programming > Help with understanding EL bar references


Last Updated on January 30, 2022


Upcoming Webinars and Events
 

NinjaTrader Indicator Challenge!

Ongoing
     



Copyright © 2023 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada), 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