NexusFi: Find Your Edge


Home Menu

 





Help with understanding EL bar references


Discussion in EasyLanguage Programming

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




 
Search this Thread
  #1 (permalink)
oldhickory
Honolulu, HI
 
Posts: 1 since Jan 2022
Thanks Given: 1
Thanks Received: 0

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:	163
Size:	56.4 KB
ID:	321802   Click image for larger version

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

Can you help answer these questions
from other members on NexusFi?
Trump Media to sell instant access to market-moving soci …
Traders Hideout
EA
Platforms and Indicators
No book, only a stair: journaling fills where price move …
Cryptocurrency
requesting .nrd replay files from 2026 spy and qqq
The Elite Circle
My Rant with AMP Futures
Trading Reviews and Vendors
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Mes vs MNQ
6 thanks
NexusFi site changelog and issues/problem reporting
5 thanks
BERN ALGOS algo trading journal
3 thanks
Johnnys Journal
2 thanks
TopStep Trader disappointment
2 thanks
  #2 (permalink)
 kevinkdog   is a Vendor
 
Posts: 3,740 since Jul 2012
Thanks Given: 1,918
Thanks Received: 7,489


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 X Reply With Quote
Thanked by:




Last Updated on January 30, 2022


© 2026 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 - Downloads - Top
no new posts