Easylanguage: Dynamic Text Box - EasyLanguage Programming | futures io social day trading
futures io futures trading


Easylanguage: Dynamic Text Box
Updated: Views / Replies:4,998 / 21
Created: by eros1973ms Attachments:6

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 90,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

Reply
 6  
 
Thread Tools Search this Thread
 

Easylanguage: Dynamic Text Box

  #1 (permalink)
Trading Apprentice
florence
 
Futures Experience: Advanced
Platform: tradestation
Favorite Futures: forex
 
Posts: 17 since Oct 2011
Thanks: 2 given, 6 received

Easylanguage: Dynamic Text Box

I am new in this forum, hope to contribute and learn here from you all.

I am dealing with plotting a text on the chart at a fixed position (i.e. upper left corner), based on date/time/price visible on the chart. I am using getappinfo, with aiLeftDispDateTime and aiHighestDispValue, but only the last one works with text_new and set_textlocation. Basically I cant understand how to pass date&time info to text_new separatly as date and time.

Code:
vars:
IntrabarPersist date_1(0),
IntrabarPersist time_1(0),
IntrabarPersist price_1(0);

//D = StringToDate(DateTimeToString(getappinfo(aiLeftDispDateTime)));
//t = StringTotime(DateTimeToString(getappinfo(aiLeftDispDateTime)));


date_1 = getappinfo(aiLeftDispDateTime);
time_1 = getappinfo(aiLeftDispDateTime);
price_1 = getappinfo(aiHighestDispValue)-offset_points*2;

if symbol = "GS:EUR A0-FX" and (time_1<>time_1[1] or price_1<>price_1[1]) then
print(
symbol,
"data-> ",
StringToDate(DateTimeToString(getappinfo(aiLeftDispDateTime))),
"string data->",
datetostring(StringToDate(DateTimeToString(getappinfo(aiLeftDispDateTime)))),
"ora-> ",
StringTotime(DateTimeToString(getappinfo(aiLeftDispDateTime)))," ",
"string time->",
timetostring(StringTotime(DateTimeToString(getappinfo(aiLeftDispDateTime)))), " ",
getappinfo(aiHighestDispValue):0:4,
setup_count_buy," ",
setup_count_sell,
" ",
getappinfo(aiLeftDispDateTime)
);

if date_1<>date_1[1] or time_1>time_1[1] or price_1<>price_1[1] then
begin
id_3=text_new(
date_1,
time_1,
price_1,
"test test test test"
);
value2=text_setlocation(id_3, date_1, time_1, price_1);
end;

I have inserted both the text_new command and the print command, to check the variables values.
What I can understand is that the print command correctly gets the date/time values of the DISPLAYED series, while the text_new command seems to disregard and continue to plot on the first bar of the entire series, even if not visible.
I have also tried to convert the date&time resulting from the getappinfo to string and then back to values separating date and time (exactly as in the print command) but this make no difference:

date_1 = stringtodate(DateTimeToString(getappinfo(aiLeftDispDateTime)));
time_1 = stringtotime(DateTimeToString(getappinfo(aiLeftDispDateTime)));

any advice?

thank you for your help

Attached Thumbnails
Easylanguage: Dynamic Text Box-1.jpg   Easylanguage: Dynamic Text Box-2.jpg  
Reply With Quote
 
  #2 (permalink)
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.

 
  #3 (permalink)
 Vendor: tradingcode.net 
The Netherlands
 
Futures Experience: None
Platform: MultiCharts, TradingView
Favorite Futures: ...
 
Jura's Avatar
 
Posts: 774 since Apr 2010
Thanks: 2,347 given, 661 received



eros1973ms View Post
(..)Basically I cant understand how to pass date&time info to text_new separatly as date and time. (..)

You mean something like ...
 
Code
backtestTimeGV         = el_datetodatetime(CurrentDate) + el_timetodatetime_s(CurrentTime_s);
backtestTimeDate     = Text(FormatTime("HHmm", backtestTimeGV), ".", FormatDate("ddMMyy", backtestTimeGV));
(where the DateTime numeric value is split in a time with 'HHmm' format (so 0815 for fifteen minutes pas eight in the morning), and date in 'ddMMyy' format (so 261011 for October 26th 2011)).

Reply With Quote
The following user says Thank You to Jura for this post:
 
  #4 (permalink)
Trading Apprentice
florence
 
Futures Experience: Advanced
Platform: tradestation
Favorite Futures: forex
 
Posts: 17 since Oct 2011
Thanks: 2 given, 6 received


Jura View Post
You mean something like ...
 
Code
backtestTimeGV         = el_datetodatetime(CurrentDate) + el_timetodatetime_s(CurrentTime_s);
backtestTimeDate     = Text(FormatTime("HHmm", backtestTimeGV), ".", FormatDate("ddMMyy", backtestTimeGV));
(where the DateTime numeric value is split in a time with 'HHmm' format (so 0815 for fifteen minutes pas eight in the morning), and date in 'ddMMyy' format (so 261011 for October 26th 2011)).

Hi Jura, thanks for your reply.
are those formats readable by the text_new function?
I mean, can I write:

text_new(formatDate("ddMMyy", getappinfo(aiLeftDispDateTime)), FormatTime("ddMMyy", getappinfo(aiLeftDispDateTime)), getappinfo(aiHighestDispValue), "test text")

Reply With Quote
 
  #5 (permalink)
Trading Apprentice
florence
 
Futures Experience: Advanced
Platform: tradestation
Favorite Futures: forex
 
Posts: 17 since Oct 2011
Thanks: 2 given, 6 received


eros1973ms View Post
Hi Jura, thanks for your reply.
are those formats readable by the text_new function?
I mean, can I write:

text_new(formatDate("ddMMyy", getappinfo(aiLeftDispDateTime)), FormatTime("ddMMyy", getappinfo(aiLeftDispDateTime)), getappinfo(aiHighestDispValue), "test text")

no, I have tried, but this values cannot be entered in the text_new function, it is expecting easylanguage format of date and time... looking at my print results, it should be accomplished by

date_1 = stringtodate(DatetimeToString(getappinfo(aiLeftDispDateTime));
time_1 = stringtotime(DatetimeToString(getappinfo(aiLeftDispDateTime));

but this does not work...I mean, the code is ok, but the text is not printed on the first bar of the displayed values..

Reply With Quote
 
  #6 (permalink)
 Vendor: tradingcode.net 
The Netherlands
 
Futures Experience: None
Platform: MultiCharts, TradingView
Favorite Futures: ...
 
Jura's Avatar
 
Posts: 774 since Apr 2010
Thanks: 2,347 given, 661 received


eros1973ms View Post
no, I have tried, but this values cannot be entered in the text_new function (..)

Really? Works fine here:

 
Code
variables: textStr("");

if LastBarOnChart_s = true then begin

    // Generate text string
    textStr = Text("Leftmost time & date: ", FormatTime("HH:mm", getappinfo(aiLeftDispDateTime)), Spaces(3),        
        formatDate("dd-MM-yyyy", getappinfo(aiLeftDispDateTime)), NewLine,
        "Rightmost time & date: ", FormatTime("HH:mm", getappinfo(airightdispdatetime)), Spaces(3),
        formatDate("dd-MM-yyyy", getappinfo(airightdispdatetime)));
        
    value1 = Text_new_s(Date, Time_s, Low -0.02, textStr);
    value2 = Text_SetStyle(value1, 1, 0);

end;
(See attached screenshot)

Note that the Text_new requires a string input.

Attached Thumbnails
Easylanguage: Dynamic Text Box-textnew.png  
Reply With Quote
 
  #7 (permalink)
Trading Apprentice
florence
 
Futures Experience: Advanced
Platform: tradestation
Favorite Futures: forex
 
Posts: 17 since Oct 2011
Thanks: 2 given, 6 received


Jura View Post
Really? Works fine here:

 
Code
variables: textStr("");

if LastBarOnChart_s = true then begin

    // Generate text string
    textStr = Text("Leftmost time & date: ", FormatTime("HH:mm", getappinfo(aiLeftDispDateTime)), Spaces(3),        
        formatDate("dd-MM-yyyy", getappinfo(aiLeftDispDateTime)), NewLine,
        "Rightmost time & date: ", FormatTime("HH:mm", getappinfo(airightdispdatetime)), Spaces(3),
        formatDate("dd-MM-yyyy", getappinfo(airightdispdatetime)));
        
    value1 = Text_new_s(Date, Time_s, Low -0.02, textStr);
    value2 = Text_SetStyle(value1, 1, 0);

end;
(See attached screenshot)

Note that the Text_new requires a string input.

Actually in your example your are passing the formatted values to the string, while text_new gets the normal Date input (I dont know how time_s is defined, but again it is not the formatted time that you use to compose the text).
Am I wrong?

Reply With Quote
 
  #8 (permalink)
 Vendor: tradingcode.net 
The Netherlands
 
Futures Experience: None
Platform: MultiCharts, TradingView
Favorite Futures: ...
 
Jura's Avatar
 
Posts: 774 since Apr 2010
Thanks: 2,347 given, 661 received


eros1973ms View Post
Actually in your example your are passing the formatted values to the string, while text_new gets the normal Date input (I dont know how time_s is defined, but again it is not the formatted time that you use to compose the text).
Am I wrong?

So, you want to use the aiLeftDispDateTime and aiRightDispDateTime to plot the text, using them as coordinates for that? In that case, my apologies, then I mistakenly assumed that you wanted to convert them to strings, and use them in the plotted text.

Try this to use aiLeftDispDateTime and aiRightDispDateTime to use as "coordinates" for the placement of Text_New_s:
 
Code
variables: leftDate(0), leftTime(0), rightDate(0), rightTime(0);

if LastBarOnChart_s = true then begin

    leftDate = JulianToDate(GetAppInfo(aiLeftDispDateTime));
    leftTime = datetime2eltime_s(GetAppInfo(aiLeftDispDateTime));

    value10 = Text_new_s(leftDate, leftTime, Low - 0.02, "Hello");
    value11 = Text_SetStyle(value10, 0, 2);
    
    rightDate = JulianToDate(GetAppInfo(aiRightDispDateTime));
    rightTime = datetime2eltime_s(GetAppInfo(aiRightDispDateTime));
    
    value15 = Text_new_s(rightDate, rightTime, High + 0.02, "GoodBye");
    value16 = Text_SetStyle(value15, 1, 2);
    
end;
(see attached screenshot)

If this is also not what you mean, please be extremely clear and brief on what you want to achieve, because in that case I don't follow what you want to do.

Attached Thumbnails
Easylanguage: Dynamic Text Box-placementwithdisp.png  
Reply With Quote
The following user says Thank You to Jura for this post:
 
  #9 (permalink)
Trading Apprentice
florence
 
Futures Experience: Advanced
Platform: tradestation
Favorite Futures: forex
 
Posts: 17 since Oct 2011
Thanks: 2 given, 6 received


Jura View Post
Really? Works fine here:

 
Code
variables: textStr("");

if LastBarOnChart_s = true then begin

    // Generate text string
    textStr = Text("Leftmost time & date: ", FormatTime("HH:mm", getappinfo(aiLeftDispDateTime)), Spaces(3),        
        formatDate("dd-MM-yyyy", getappinfo(aiLeftDispDateTime)), NewLine,
        "Rightmost time & date: ", FormatTime("HH:mm", getappinfo(airightdispdatetime)), Spaces(3),
        formatDate("dd-MM-yyyy", getappinfo(airightdispdatetime)));
        
    value1 = Text_new_s(Date, Time_s, Low -0.02, textStr);
    value2 = Text_SetStyle(value1, 1, 0);

end;
(See attached screenshot)

Note that the Text_new requires a string input.


Jura View Post
So, you want to use the aiLeftDispDateTime and aiRightDispDateTime to plot the text, using them as coordinates for that? In that case, my apologies, then I mistakenly assumed that you wanted to convert them to strings, and use them in the plotted text.

Try this to use aiLeftDispDateTime and aiRightDispDateTime to use as "coordinates" for the placement of Text_New_s:
 
Code
variables: leftDate(0), leftTime(0), rightDate(0), rightTime(0);

if LastBarOnChart_s = true then begin

    leftDate = JulianToDate(GetAppInfo(aiLeftDispDateTime));
    leftTime = datetime2eltime_s(GetAppInfo(aiLeftDispDateTime));

    value10 = Text_new_s(leftDate, leftTime, Low - 0.02, "Hello");
    value11 = Text_SetStyle(value10, 0, 2);
    
    rightDate = JulianToDate(GetAppInfo(aiRightDispDateTime));
    rightTime = datetime2eltime_s(GetAppInfo(aiRightDispDateTime));
    
    value15 = Text_new_s(rightDate, rightTime, High + 0.02, "GoodBye");
    value16 = Text_SetStyle(value15, 1, 2);
    
end;
(see attached screenshot)

If this is also not what you mean, please be extremely clear and brief on what you want to achieve, because in that case I don't follow what you want to do.

Thanks for your patience Jura!
it is exactly what I want to do.
the date now is working perfectly, thank you.
Only problem with this is that I don't have a DatetimetoEltime function! I am on v8.7...maybe this is why?
I only have the datetimetostring and the stringtodate, but does not seem to work.

Reply With Quote
The following user says Thank You to eros1973ms for this post:
 
  #10 (permalink)
 Vendor: tradingcode.net 
The Netherlands
 
Futures Experience: None
Platform: MultiCharts, TradingView
Favorite Futures: ...
 
Jura's Avatar
 
Posts: 774 since Apr 2010
Thanks: 2,347 given, 661 received



eros1973ms View Post
Only problem with this is that I don't have a DatetimetoEltime function! I am on v8.7...maybe this is why?
I only have the datetimetostring and the stringtodate, but does not seem to work.

Hm, true, TradeStation doesn't have that word (I'm a MultiCharts user). I've just scanned through the TradeStation 8.3 EasyLanguage manual, and using the reserved words that I found there, something like this should work..

 
Code
variables: leftDate(0), leftTime(0), rightDate(0), rightTime(0);

if LastBarOnChart_s = true then begin

    leftDate = JulianToDate(GetAppInfo(aiLeftDispDateTime));
    leftTime = (HoursFromDateTime(GetAppInfo(aiLeftDispDateTime)) * 10000) + 
        (MinutesFromDateTime(GetAppInfo(aiLeftDispDateTime)) * 100) +
        SecondsFromDateTime(GetAppInfo(aiLeftDispDateTime));

    value10 = Text_new_s(leftDate, leftTime, Low - 0.02, "Hello");
    value11 = Text_SetStyle(value10, 0, 2);
    
    rightDate = JulianToDate(GetAppInfo(aiRightDispDateTime));
    rightTime = (HoursFromDateTime(GetAppInfo(aiRightDispDateTime)) * 10000) + 
        (MinutesFromDateTime(GetAppInfo(aiRightDispDateTime)) * 100) +
        SecondsFromDateTime(GetAppInfo(aiRightDispDateTime));
    
    value15 = Text_new_s(rightDate, rightTime, High + 0.02, "GoodBye");
    value16 = Text_SetStyle(value15, 1, 2);
    
end;
Since I don't use TradeStation, I don't know if it would work, but it contains a workaround for not using DateTime2ELTime_s and thus (in theory) should work for TradeStation (it works here on MultiCharts fine).

Good luck.

Reply With Quote
The following 2 users say Thank You to Jura for this post:

Reply



futures io > > > > > Easylanguage: Dynamic Text Box

Thread Tools Search this Thread
Search this Thread:

Advanced Search



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

Jigsaw Trading: TBA

Elite only

FuturesTrader71: TBA

Elite only

NinjaTrader: TBA

Jan 18

RandBots: TBA

Jan 23

GFF Brokers & CME Group: Futures & Bitcoin

Elite only

Adam Grimes: TBA

Elite only

Ran Aroussi: TBA

Elite only
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
Dynamic Properties baruchs NinjaTrader Programming 23 March 18th, 2017 11:02 AM
Easylanguage: Function to Plot Text Verticaly nunoonline EasyLanguage Programming 2 December 22nd, 2010 06:17 AM
Script for dynamic NT6.5 data box updates Sabrynne Traders Hideout 5 September 13th, 2010 12:46 PM
How to insert NewLine in EasyLanguage Text() ? Big Mike EasyLanguage Programming 9 March 28th, 2010 09:30 AM
ECO2New - how to get rid of the ECO Diff Text Box Todd NinjaTrader Programming 2 June 17th, 2009 09:05 PM


All times are GMT -4. The time now is 11:09 AM.

Copyright © 2017 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 2017-12-13 in 0.14 seconds with 20 queries on phoenix via your IP 54.227.51.103