ELA debugging problems when tracking the intraday market as with DAX livechart - futures io
futures io futures trading



ELA debugging problems when tracking the intraday market as with DAX livechart


Discussion in EasyLanguage Programming

Updated
    1. trending_up 860 views
    2. thumb_up 2 thanks given
    3. group 2 followers
    1. forum 6 posts
    2. attach_file 2 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
 

ELA debugging problems when tracking the intraday market as with DAX livechart

(login for full post details)
  #1 (permalink)
Sverige
 
Experience: Advanced
Platform: Multicharts, Tradestation
Trading: OMX futures
 
Posts: 5 since Aug 2014
Thanks: 1 given, 1 received

I have debugging problems in Easylanguage when I try to programme tracking of the Intraday high and low, both value and time. For some reason when I debugg my indicators i get yesterdays value.

Can anyone give me an advice what is wrong?

DAX live chart has that displayed

Link: Börse Frankfurt

For some reason when I debugg my indicators i get yesterdays value.
Can anyone give me an advice what is wrong?

Below is the code for the high and low value and time tracking:

variables:
DayOpen( 0 ),
DayHigh( 0 ),
DayLow( 0 ),
TimeatHigh( 0 ),
TimeatLow( 0 );

if BarType <= 1 then { ie, if minute or tick bars }
begin
if Date <> Date[1] and BarStatus( DataNum ) = 2 then { ie, if new day }
begin

{ re-initialize O,H,L for the new day }
DayOpen = Open ;
DayHigh = high ;
DayLow = low ;

{ track the new high and low }
if High > DayHigh then
begin
DayHigh = High ;
TimeatHigh = Time;
end ;

if Low < DayLow then
begin
DayLow = Low ;
TimeatLow = Time;
end ;

end ;
end
else
RaiseRunTimeError( "Requires intraday bars." ) ;

Started this thread Reply With Quote

 
Best Threads (Most Thanked)
in the last 7 days on futures io
Selling Options on Futures?
109 thanks
Battlestations: Show us your trading desks!
108 thanks
Rank your Futures vs Stocks trading priority
55 thanks
Want your NinjaTrader indicator created, free?
27 thanks
Whats this confusion with margins?
21 thanks
 
(login for full post details)
  #3 (permalink)
 
 
Posts: 2,230 since Apr 2013
Thanks: 409 given, 1,471 received


gorbod,

from your code it appears you only track the high and low of the very first bar of a new day.

Something like this might get you going (I didn't test the code, though):

 
Code
variables:
DayOpen( 0 ),
DayHigh( 0 ),
DayLow( 0 ),
TimeatHigh( 0 ),
TimeatLow( 0 );

if BarType <= 1 then { ie, if minute or tick bars }
begin
if Date <> Date[1] and BarStatus( DataNum ) = 2 then { ie, if new day }
begin

{ re-initialize O,H,L for the new day }
DayOpen = Open ;
DayHigh = low; //set to low to make sure it gets updated further down
DayLow = high ; //set to high to make sure it gets updated further down
end ; //if Date <> Date[1] and BarStatus( DataNum ) = 2 then { ie, if new day }
{ track the new high and low }
if High > DayHigh then
begin
DayHigh = High ;
TimeatHigh = Time;
end ;

if Low < DayLow then
begin
DayLow = Low ;
TimeatLow = Time;
end ;

end
else
RaiseRunTimeError( "Requires intraday bars." ) ;
Regards,

ABCTG

Follow me on Twitter Reply With Quote
The following user says Thank You to ABCTG for this post:
 
(login for full post details)
  #4 (permalink)
Sverige
 
Experience: Advanced
Platform: Multicharts, Tradestation
Trading: OMX futures
 
Posts: 5 since Aug 2014
Thanks: 1 given, 1 received

Thanks now the code seems to work better and for todays high everything seems ok,
but for todays low the value is 0.
From printlog:
Date 1160902.00 IntradayHigh 2186.75 Time 1620.00 Intradaylow 0.00 Time 0.00

To ensure that there is no error in data did I save the data and made a quality ckeck in excel and the lowest value is 2164.25.

For some reason does todayshigh work fine but not todays low.
Very confusing, has Tradestation any errorhandling or memory problems causing that the variables returns a 0 or what can be the problem?

Started this thread Reply With Quote
 
(login for full post details)
  #5 (permalink)
 
 
Posts: 2,230 since Apr 2013
Thanks: 409 given, 1,471 received

gorbod,

it's more likely coming either from the code or chart setup and not from a TS error or memory problem. Although the latter is a possibility I'd suggest to check out the code and setup first.
What is the exact code you used for your testing, including the print commands?

What is the exact chart setting you have been using, including interval and days back (maybe post a screenshot of the symbol settings as shown under format symbol). Is there more than one data stream on the chart? Basically provide all information that one would need to reproduce what you are seeing on your end.

Regards,

ABCTG

Follow me on Twitter Reply With Quote
 
(login for full post details)
  #6 (permalink)
Sverige
 
Experience: Advanced
Platform: Multicharts, Tradestation
Trading: OMX futures
 
Posts: 5 since Aug 2014
Thanks: 1 given, 1 received

Thanks for your advice!
The exact code is that code you provided.

Data format 15min @ES , 10 days back, only one data stream, Screen shoot enclosed.
Can session settings cause errors in variables?

Started this thread Reply With Quote
 
(login for full post details)
  #7 (permalink)
 
 
Posts: 2,230 since Apr 2013
Thanks: 409 given, 1,471 received

Gorbod,

thanks for the screenshot. I have added plot statements to the code and tested it. The problem is
 
Code
if Date <> Date[1] and BarStatus( Datanum ) = 2 then
won't work as Datanum returns a value of 0.

You will have to set this to the datastream you apply the study to (1 in your case) and the code will work fine.

This is a bit of a pitfall here, as the compiler shouldn't compile the code as DataNum is neither a reserved word nor a variable in your case, but TS uses DataNum as placeholder in the help file. So maybe something got mixed up.

From the TS help:
BarStatus(DataNum)

DataNum is a numeric expression representing the data stream that is being evaluated. 1 refers to Data1, 2 to Data2 and so on. DataNum can be between 1 and 50, inclusive.

Regards,

ABCTG

Follow me on Twitter Reply With Quote
The following user says Thank You to ABCTG for this post:


futures io Trading Community Platforms and Indicators EasyLanguage Programming > ELA debugging problems when tracking the intraday market as with DAX livechart


Last Updated on September 6, 2016


Upcoming Webinars and Events
 

NinjaTrader Indicator Challenge!

Ongoing
 

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

March
 

Importance of Finding Your Own Way w/Adam Grimes

Elite only
 

Journal Challenge w/Jigsaw

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