SessionLastBar & Strategy Engine Calculation - EasyLanguage Programming | futures io social day trading
futures io futures trading


SessionLastBar & Strategy Engine Calculation
Updated: Views / Replies:825 / 9
Created: by juveman11 Attachments:1

Welcome to futures io.

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

futures io is the largest futures trading community on the planet, with over 100,000 members. At futures io, our goal has always been and always will be to create a friendly, positive, forward-thinking community where members can openly share and discuss everything the world of trading has to offer. The community is one of the friendliest you will find on any subject, with members going out of their way to help others. Some of the primary differences between futures io and other trading sites revolve around the standards of our community. Those standards include a code of conduct for our members, as well as extremely high standards that govern which partners we do business with, and which products or services we recommend to our members.

At futures io, our focus is on quality education. No hype, gimmicks, or secret sauce. The truth is: trading is hard. To succeed, you need to surround yourself with the right support system, educational content, and trading mentors Ė all of which you can find on futures io, utilizing our social trading environment.

With futures io, you can find honest trading reviews on brokers, trading rooms, indicator packages, trading strategies, and much more. Our trading review process is highly moderated to ensure that only genuine users are allowed, so you donít need to worry about fake reviews.

We are fundamentally different than most other trading sites:
  • We are here to help. Just let us know what you need.
  • We work extremely hard to keep things positive in our community.
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts.
  • We firmly believe in and encourage sharing. The holy grail is within you, we can help you find it.
  • We expect our members to participate and become a part of the community. Help yourself by helping others.

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

 
 
Thread Tools
 

SessionLastBar & Strategy Engine Calculation

 
Elite Member
Montreal, QC, Canada
 
Futures Experience: Beginner
Platform: MultiCharts
Favorite Futures: Crude CL
 
juveman11's Avatar
 
Posts: 17 since Jun 2016
Thanks: 6 given, 6 received

SessionLastBar & Strategy Engine Calculation

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

Attached Thumbnails
SessionLastBar & Strategy Engine Calculation-example.png  
 
 
Quick Summary
Quick Summary Post

Quick Summary is created and edited by users like you... Add FAQ's, Links and other Relevant Information by clicking the edit button in the lower right hand corner of this message.

 
 
 Vendor: www.abctradinggroup.com 
Hamburg Germany
 
Futures Experience: Advanced
Platform: Multicharts, Tradestation
Broker/Data: DTN IQ
Favorite Futures: ES
 
Posts: 1,807 since Apr 2013
Thanks: 293 given, 1,102 received


juveman11,

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:

 
Code
Print( DateTimeToString( DateTime ), "; sessionlastbar = ", sessionlastbar, "; sessionlastbar[1] = ", sessionlastbar[1], "; mycounter = ", mycounter, "; mycount = ", mycount ) ;
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.

Regards,

ABCTG

 
 
Elite Member
Montreal, QC, Canada
 
Futures Experience: Beginner
Platform: MultiCharts
Favorite Futures: Crude CL
 
juveman11's Avatar
 
Posts: 17 since Jun 2016
Thanks: 6 given, 6 received

ABCTG,

The session ends at the 16:59 bar, it even shows a dotted vertical line on my chart and I checked by plotting the session end time.

Using the print function, it is telling me that BOTH sessionlastbar and sessionlastbar[1] are true at the 16:59 bar every single time....strange

 
 
 Vendor: www.abctradinggroup.com 
Hamburg Germany
 
Futures Experience: Advanced
Platform: Multicharts, Tradestation
Broker/Data: DTN IQ
Favorite Futures: ES
 
Posts: 1,807 since Apr 2013
Thanks: 293 given, 1,102 received

juveman11,

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.

Regards,

ABCTG

The following user says Thank You to ABCTG for this post:
 
 
Elite Member
Montreal, QC, Canada
 
Futures Experience: Beginner
Platform: MultiCharts
Favorite Futures: Crude CL
 
juveman11's Avatar
 
Posts: 17 since Jun 2016
Thanks: 6 given, 6 received


ABCTG View Post
juveman11,

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.

Regards,

ABCTG

Just tried it and you're right! Thanks!

 
 
 Vendor: www.abctradinggroup.com 
Hamburg Germany
 
Futures Experience: Advanced
Platform: Multicharts, Tradestation
Broker/Data: DTN IQ
Favorite Futures: ES
 
Posts: 1,807 since Apr 2013
Thanks: 293 given, 1,102 received

juveman11,

great, thanks for letting me know.

Regards,

ABCTG

 
 
Elite Member
Norwich, UK
 
Futures Experience: Beginner
Platform: Multiple:research&executi
Broker/Data: Started with Stage5/OEC ... multiple
Favorite Futures: Anything found profitable goes ...
 
andby's Avatar
 
Posts: 146 since Jul 2012
Thanks: 82 given, 59 received


ABCTG View Post
juveman11,

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.

Regards,

ABCTG

What's the definition of this function (sessionlastbar) - I don't see it available in Tradestation.

thx

 
 
 Vendor: www.abctradinggroup.com 
Hamburg Germany
 
Futures Experience: Advanced
Platform: Multicharts, Tradestation
Broker/Data: DTN IQ
Favorite Futures: ES
 
Posts: 1,807 since Apr 2013
Thanks: 293 given, 1,102 received

andby,

it's a reserved word that is exclusive to Multicharts.

Regards,

ABCTG


andby View Post
What's the definition of this function (sessionlastbar) - I don't see it available in Tradestation.

thx


 
 
Elite Member
Norwich, UK
 
Futures Experience: Beginner
Platform: Multiple:research&executi
Broker/Data: Started with Stage5/OEC ... multiple
Favorite Futures: Anything found profitable goes ...
 
andby's Avatar
 
Posts: 146 since Jul 2012
Thanks: 82 given, 59 received



ABCTG View Post
andby,

it's a reserved word that is exclusive to Multicharts.

Regards,

ABCTG

Alright, so no custom equivalent function written in EL that could be imported?

Understood ...


 



futures io > > > > > SessionLastBar & Strategy Engine Calculation
Thread Tools



Upcoming Webinars and Events (4:30PM ET unless noted)

September Journal Challenge (sponsored by TopstepTrader)

September

Battlestations! Win $947 in prizes for showing us your trading desk!

October
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
SessionLastBar code from MC to TS gorbod TradeStation 1 June 13th, 2016 05:25 AM
HSI / HKFE Exchange Engine Format - For Reconstructed T&S Setting samsupertrader Emini Index Futures Trading 2 May 10th, 2016 11:23 PM
Bid & Ask Depth Bars cumulative/running sum calculation hobart Sierra Chart 0 October 14th, 2015 07:59 AM
Calculation program or spreadsheet calculation taken from drawing values? powder NinjaTrader 0 August 14th, 2015 03:27 PM


All times are GMT -4. The time now is 07:53 PM. (this page content is cached, log in for real-time version)

Copyright © 2018 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
Page generated 2018-10-20 in 0.16 seconds with 15 queries on phoenix