Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now for Free
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 for basic access, or support us by becoming an Elite Member -- see if you qualify for a discount below.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
Hi guys, I have finished reading the EL essentials PDF and I'm trying to understand how the machine calculates a strategy. The PDF mentions that by default, the strategy is calculated once at the CLOSE of the bar.
Here's a simple code on 60 min GBP/USD. I understand what's going on but trying to figure out how the machine processed it.
input: mycounter(0);
vars: mycount(0) ;
if sessionlastbar[1] then mycount = 0;
mycount= mycount +1;
if mycounter = mycount then buy next bar at market;
if marketposition = 1 then sell next bar at market;
When mycounter=1 this code buys at the open of the first bar of the session and sells at the open of the bar after it as shown in the attached screenshot.
At the close of the last bar in the session (the 16:59 bar) ---> sessionlastbar[1] is FALSE so how is it buying at the open of the 18:00 bar? It only becomes true once the 18:00 bar closes.
Please excuse my newbie-ness
Can you help answer these questions from other members on NexusFi?
I would suggest to add print statements to your code, so you know what's going on internally.
Something like this should show you what your code sees:
Based on that you should gain more insights. I'd also suggest checking your session template, just to make sure that there aren't sessions ending at 1600.
not all reserved words can be back referenced (meaning give you the values they had on previous bars - they could simply return the current bar's value even when you check for [1]), therefore it's usually a good practice to store the reserved word in a variable and reference the variable in your code.