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


Easylanguage: Dynamic Text Box
Updated: Views / Replies:5,007 / 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

  #11 (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
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.

yeeeeahhhhhhhhhhhhhhhhhh

I had to make some correction, as text_new is expecting the time in this format: hhmm.ss, so the working version for tradestation is:
 
Code
(HoursFromDateTime(GetAppInfo(aiLeftDispDateTime)) * 100) + 
(MinutesFromDateTime(GetAppInfo(aiLeftDispDateTime))) +
SecondsFromDateTime(GetAppInfo(aiLeftDispDateTime));

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

I continue here... Jura's help has been fantastic!

Now the text is correctly positioned and moved anytime I resize the chart.
One single problem: the first plotted test (the one plotted when I activate the indicator) remains there.
Then when I resize, a new text is plotted in the correct position and moved anytime I resize, but the first plotted text remains there!

PS: also when there is a new bar, the text plotted in the previous bar in not moved but a new text is plotted.

 
Code
vars:
	date_1(0),
	time_1(0),
	price_1(0),
	hours(0),
	minut(0),
	time_2(0),
	txt_id1(-1), txt_id2(-1),
	txt_id3(-1), txt_id4(-1), txt_id5(-1);


date_1 = JulianToDate(GetAppInfo(aiLeftDispDateTime));

time_2 = (HoursFromDateTime(GetAppInfo(aiLeftDispDateTime)) * 100) + 
        (MinutesFromDateTime(GetAppInfo(aiLeftDispDateTime))) +
        SecondsFromDateTime(GetAppInfo(aiLeftDispDateTime));

price_1 = getappinfo(aiHighestDispValue)-0.5*offset_points;


//text creation and first position
		//txt_id1 = text_new(date_1, time_2, price_1, "--------------------------------");
		txt_id2 = text_new(date_1, time_2, price_1-offset_points, "Buy 	Setup       " +numtostr(setup_count_buy,0));
		txt_id3 = text_new(date_1, time_2, price_1-offset_points, "Buy 	Sequential  " +numtostr(count_dwn_buy,0));
		txt_id4 = text_new(date_1, time_2, price_1-offset_points, "Sell Setup       " +numtostr(setup_count_sell,0));
		txt_id5 = text_new(date_1, time_2, price_1-offset_points, "Sell Sequential  " +numtostr(count_dwn_sell,0));
//text position		
//value1=text_setlocation(txt_id1, date_1, time_2, price_1); //riga
value2=text_setlocation(txt_id2, date_1, time_2, price_1-offset_points); //buysetup counter
value3=text_setlocation(txt_id3, date_1, time_2, price_1-1.5*offset_points); //buysetup status
value4=text_setlocation(txt_id4, date_1, time_2, price_1-2*offset_points);
value5=text_setlocation(txt_id5, date_1, time_2, price_1-2.5*offset_points);

Attached Thumbnails
Easylanguage: Dynamic Text Box-example.jpg  

Last edited by eros1973ms; October 26th, 2011 at 02:39 PM.
Reply With Quote
 
  #13 (permalink)
Trading Apprentice
florence
 
Futures Experience: Advanced
Platform: tradestation
Favorite Futures: forex
 
Posts: 17 since Oct 2011
Thanks: 2 given, 6 received


ok, I solved!

Just put the text_new function inside a routine conditioned by currentbar=1:

 
Code
if currentbar=1 then
		begin
		//txt_id1 = text_new(date_1, time_2, price_1, "---" +text(setup_buy));
		txt_id2 = text_new(date_1, time_2, price_1-offset_points, "Buy 	Setup       " +numtostr(setup_count_buy,0));
		txt_id3 = text_new(date_1, time_2, price_1-offset_points, "Buy 	Sequential  " +numtostr(count_dwn_buy,0));
		txt_id4 = text_new(date_1, time_2, price_1-offset_points, "Sell Setup       " +numtostr(setup_count_sell,0));
		txt_id5 = text_new(date_1, time_2, price_1-offset_points, "Sell Sequential  " +numtostr(count_dwn_sell,0));
		end;

Reply With Quote
The following user says Thank You to eros1973ms for this post:
 
  #14 (permalink)
Site Administrator
Manta, Ecuador
 
Futures Experience: Advanced
Platform: My own custom solution
Favorite Futures: E-mini ES S&P 500
 
Big Mike's Avatar
 
Posts: 46,240 since Jun 2009
Thanks: 29,353 given, 83,234 received


eros1973ms View Post
ok, I solved!

Just put the text_new function inside a routine conditioned by currentbar=1:

Real quick glance, I think you can do all this using the reserve word "once":

once cleardebug;
once txt_id2 = text_new(date_1, time_2, price_1-offset_points, "Buy Setup " +numtostr(setup_count_buy,0));

and etc.

But same diff.

Mike

Due to time constraints, please do not PM me if your question can be resolved or answered on the forum.

Need help?
1) Stop changing things. No new indicators, charts, or methods. Be consistent with what is in front of you first.
2) Start a journal and post to it daily with the trades you made to show your strengths and weaknesses.
3) Set goals for yourself to reach daily. Make them about how you trade, not how much money you make.
4) Accept responsibility for your actions. Stop looking elsewhere to explain away poor performance.
5) Where to start as a trader? Watch this webinar and read this thread for hundreds of questions and answers.
6)
Help using the forum? Watch this video to learn general tips on using the site.

If you want
to support our community, become an Elite Member.

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


Big Mike View Post
Real quick glance, I think you can do all this using the reserve word "once":

once cleardebug;
once txt_id2 = text_new(date_1, time_2, price_1-offset_points, "Buy Setup " +numtostr(setup_count_buy,0));

and etc.

But same diff.

Mike

Thanks Mike.

But both with my version and your version, the box positioning work ok, but I dont know why, the variable dispays wrong values, as confirmed by the print command on the same variables (this does not happen without the "once" command or the check for the currentbar=1).
Actual piece of code:
 
Code
vars:
	date_1(0),
	time_1(0),
	price_1(0),
	hours(0),
	minut(0),
	time_2(0),
	txt_id1(-1), txt_id2(-1),
	txt_id3(-1), txt_id4(-1), txt_id5(-1);


date_1 = JulianToDate(GetAppInfo(aiLeftDispDateTime));

time_2 = (HoursFromDateTime(GetAppInfo(aiLeftDispDateTime)) * 100) + 
        (MinutesFromDateTime(GetAppInfo(aiLeftDispDateTime))) +
        SecondsFromDateTime(GetAppInfo(aiLeftDispDateTime));

price_1 = getappinfo(aiHighestDispValue)-0.5*offset_points;


//text creation and first position
		//txt_id1 = text_new(date_1, time_2, price_1, "--------------------------------");
                once cleardebug;
		once txt_id2 = text_new(date_1, time_2, price_1-offset_points, "Buy 	Setup       " +numtostr(setup_count_buy,0));
		once txt_id3 = text_new(date_1, time_2, price_1-offset_points, "Buy 	Sequential  " +numtostr(count_dwn_buy,0));
		once txt_id4 = text_new(date_1, time_2, price_1-offset_points, "Sell Setup       " +numtostr(setup_count_sell,0));
		once txt_id5 = text_new(date_1, time_2, price_1-offset_points, "Sell Sequential  " +numtostr(count_dwn_sell,0));
//text position		

value2=text_setlocation(txt_id2, date_1, time_2, price_1-offset_points); //buysetup counter
value3=text_setlocation(txt_id3, date_1, time_2, price_1-1.5*offset_points); //buysetup status
value4=text_setlocation(txt_id4, date_1, time_2, price_1-2*offset_points);
value5=text_setlocation(txt_id5, date_1, time_2, price_1-2.5*offset_points);


if symbol = "GS:EUR A0-FX" then 
	print(
	date, "  ",
	time, "  ",
	"Setup count Buy", "  ",
	setup_count_buy, "  ",
	"Sequential Buy", "  ",
	count_dwn_buy, "  ",
	"Setup count Sell", "  ",
	setup_count_sell, "  ",
	"Sequential Sell", "  ",
	count_dwn_sell
	);

Attached Thumbnails
Easylanguage: Dynamic Text Box-error.jpg  

Last edited by eros1973ms; October 27th, 2011 at 08:01 AM.
Reply With Quote
 
  #16 (permalink)
Trading Apprentice
florence
 
Futures Experience: Advanced
Platform: tradestation
Favorite Futures: forex
 
Posts: 17 since Oct 2011
Thanks: 2 given, 6 received



solved!!!

sure, the once command allowed for the txt creation only once !! I had to re-evaluate the string.
Final code:

 
Code
vars:
	date_1(0),
	time_1(0),
	price_1(0),
	hours(0),
	minut(0),
	time_2(0),
	txt_id1(-1), txt_id2(-1),
	txt_id3(-1), txt_id4(-1), txt_id5(-1);


date_1 = JulianToDate(GetAppInfo(aiLeftDispDateTime));

time_2 = (HoursFromDateTime(GetAppInfo(aiLeftDispDateTime)) * 100) + 
        (MinutesFromDateTime(GetAppInfo(aiLeftDispDateTime))) +
        SecondsFromDateTime(GetAppInfo(aiLeftDispDateTime));

price_1 = getappinfo(aiHighestDispValue)-0.5*offset_points;


//text creation and first position
		//txt_id1 = text_new(date_1, time_2, price_1, "--------------------------------");
once cleardebug;
		once txt_id2 = text_new(date_1, time_2, price_1-offset_points, "Buy 	Setup       " +numtostr(setup_count_buy,0));
		once txt_id3 = text_new(date_1, time_2, price_1-offset_points, "Buy 	Sequential  " +numtostr(count_dwn_buy,0));
		once txt_id4 = text_new(date_1, time_2, price_1-offset_points, "Sell Setup       " +numtostr(setup_count_sell,0));
		once txt_id5 = text_new(date_1, time_2, price_1-offset_points, "Sell Sequential  " +numtostr(count_dwn_sell,0));
//text position		
//value1=text_setlocation(txt_id1, date_1, time_2, price_1); //riga

value10= text_setstring(txt_id2, "Buy 	Setup       " +numtostr(setup_count_buy,0));
value2=text_setlocation(txt_id2, date_1, time_2, price_1-offset_points); //buysetup counter

value11= text_setstring(txt_id3, "Buy 	Sequential  " +numtostr(count_dwn_buy,0));
value3=text_setlocation(txt_id3, date_1, time_2, price_1-1.5*offset_points); //buysetup status

value12= text_setstring(txt_id4, "Sell Setup       " +numtostr(setup_count_sell,0));
value4=text_setlocation(txt_id4, date_1, time_2, price_1-2*offset_points);

value13= text_setstring(txt_id5, "Sell Sequential  " +numtostr(count_dwn_sell,0));
value5=text_setlocation(txt_id5, date_1, time_2, price_1-2.5*offset_points);


if symbol = "GS:EUR A0-FX" then 
	print(
	date, "  ",
	time, "  ",
	"Setup count Buy", "  ",
	setup_count_buy, "  ",
	"Sequential Buy", "  ",
	count_dwn_buy, "  ",
	"Setup count Sell", "  ",
	setup_count_sell, "  ",
	"Sequential Sell", "  ",
	count_dwn_sell
	);

Reply With Quote
The following user says Thank You to eros1973ms for this post:
 
  #17 (permalink)
Site Administrator
Manta, Ecuador
 
Futures Experience: Advanced
Platform: My own custom solution
Favorite Futures: E-mini ES S&P 500
 
Big Mike's Avatar
 
Posts: 46,240 since Jun 2009
Thanks: 29,353 given, 83,234 received


eros1973ms View Post


solved!!!

sure, the once command allowed for the txt creation only once !! I had to re-evaluate the string.
Final code:

Yes sorry, I did not look very close at your code

Mike

Due to time constraints, please do not PM me if your question can be resolved or answered on the forum.

Need help?
1) Stop changing things. No new indicators, charts, or methods. Be consistent with what is in front of you first.
2) Start a journal and post to it daily with the trades you made to show your strengths and weaknesses.
3) Set goals for yourself to reach daily. Make them about how you trade, not how much money you make.
4) Accept responsibility for your actions. Stop looking elsewhere to explain away poor performance.
5) Where to start as a trader? Watch this webinar and read this thread for hundreds of questions and answers.
6)
Help using the forum? Watch this video to learn general tips on using the site.

If you want
to support our community, become an Elite Member.

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


Big Mike View Post
Yes sorry, I did not look very close at your code

Mike


why sorry? thanks for your help!

Reply With Quote
The following user says Thank You to eros1973ms for this post:
 
  #19 (permalink)
Site Administrator
Manta, Ecuador
 
Futures Experience: Advanced
Platform: My own custom solution
Favorite Futures: E-mini ES S&P 500
 
Big Mike's Avatar
 
Posts: 46,240 since Jun 2009
Thanks: 29,353 given, 83,234 received


eros1973ms View Post
why sorry? thanks for your help!

LOL, cuz I gave you bad advice



Mike

Due to time constraints, please do not PM me if your question can be resolved or answered on the forum.

Need help?
1) Stop changing things. No new indicators, charts, or methods. Be consistent with what is in front of you first.
2) Start a journal and post to it daily with the trades you made to show your strengths and weaknesses.
3) Set goals for yourself to reach daily. Make them about how you trade, not how much money you make.
4) Accept responsibility for your actions. Stop looking elsewhere to explain away poor performance.
5) Where to start as a trader? Watch this webinar and read this thread for hundreds of questions and answers.
6)
Help using the forum? Watch this video to learn general tips on using the site.

If you want
to support our community, become an Elite Member.

Reply With Quote
 
  #20 (permalink)
Trading Apprentice
Hong Kong
 
Futures Experience: Beginner
Platform: tradestation
Favorite Futures: stocks
 
Posts: 6 since Nov 2011
Thanks: 1 given, 1 received


Hello, Eros1973ms & Big Mike

Much thanks for your code.
Could you tell me more hint that how the text correctly positioned and moved anytime when resize the chart?
Does it is related the below vars for coding this effect?

time_1(0),
price_1(0),
hours(0),
minut(0),

Reply With Quote

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 02:16 PM.

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-15 in 0.13 seconds with 20 queries on phoenix via your IP 54.82.56.95