NexusFi: Find Your Edge


Home Menu

 





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


Discussion in EasyLanguage Programming

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




 
Search this Thread

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

  #1 (permalink)
 gorbod 
Sverige
 
Experience: Advanced
Platform: Multicharts, Tradestation
Trading: OMX futures
Posts: 5 since Aug 2014
Thanks Given: 1
Thanks Received: 1

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

Can you help answer these questions
from other members on NexusFi?
MC PL editor upgrade
MultiCharts
Better Renko Gaps
The Elite Circle
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
Exit Strategy
NinjaTrader
Increase in trading performance by 75%
The Elite Circle
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Just another trading journal: PA, Wyckoff & Trends
29 thanks
Tao te Trade: way of the WLD
24 thanks
Diary of a simple price action trader
21 thanks
My NQ Trading Journal
14 thanks
HumbleTraders next chapter
10 thanks
  #3 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,433 since Apr 2013
Thanks Given: 481
Thanks Received: 1,627


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
Thanked by:
  #4 (permalink)
 gorbod 
Sverige
 
Experience: Advanced
Platform: Multicharts, Tradestation
Trading: OMX futures
Posts: 5 since Aug 2014
Thanks Given: 1
Thanks Received: 1

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
  #5 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,433 since Apr 2013
Thanks Given: 481
Thanks Received: 1,627

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
  #6 (permalink)
 gorbod 
Sverige
 
Experience: Advanced
Platform: Multicharts, Tradestation
Trading: OMX futures
Posts: 5 since Aug 2014
Thanks Given: 1
Thanks Received: 1

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
  #7 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,433 since Apr 2013
Thanks Given: 481
Thanks Received: 1,627

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
Thanked by:




Last Updated on September 6, 2016


© 2024 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 - Privacy Policy - Downloads - Top
no new posts