Dark Theme
Light Theme
Trading Articles
Article Categories
Article Tools
Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now for Free
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 for basic access, or support us by becoming an Elite Member -- see if you qualify for a discount below.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
How to insert NewLine in EasyLanguage Text() ?
Updated March 28, 2010
Top Posters
looks_one
Big Mike
with 4 posts (0 thanks)
looks_two
aslan
with 3 posts (1 thanks)
looks_3
TIKITRADER
with 2 posts (0 thanks)
looks_4
cory
with 1 posts (0 thanks)
trending_up
9,370 views
thumb_up
1 thanks given
group
3 followers
forum
9 posts
attach_file
0 attachments
How to insert NewLine in EasyLanguage Text() ?
March 27th, 2010, 10:33 PM
Manta, Ecuador
Site Administrator Developer Swing Trader
Experience: Advanced
Platform: Custom solution
Broker: IBKR
Trading: Stocks & Futures
Frequency: Every few days
Duration: Weeks
Posts: 50,463 since Jun 2009
Thanks Given: 33,239
Thanks Received: 101,662
I can't figure it out! I'm sure it's simple but I can't find an example.
Code
Text_SetString ( pnltext , text ( " Last: " , positionprofit ( 1 ), " / Today: " , todaynet , " " ));
I want to split the "Last: xxx" and "Today: xxx" on two separate lines. I tried adding ", newline, " to the text() but it made no difference.
[img]https://nexusfi.com/v/pa4cge.png[/img]
Mike
Can you help answer these questions from other members on NexusFi?
Best Threads (Most Thanked) in the last 7 days on NexusFi
March 27th, 2010, 11:04 PM
virginia
Experience: Intermediate
Platform: ninja
Trading: NQ
Posts: 6,098 since Jun 2009
Thanks Given: 877
Thanks Received: 8,090
time to try out that legendary MC support.
March 27th, 2010, 11:07 PM
Manta, Ecuador
Site Administrator Developer Swing Trader
Experience: Advanced
Platform: Custom solution
Broker: IBKR
Trading: Stocks & Futures
Frequency: Every few days
Duration: Weeks
Posts: 50,463 since Jun 2009
Thanks Given: 33,239
Thanks Received: 101,662
cory
time to try out that legendary MC support.
LOL, if I don't have an answer by Monday I will
I figured someone here knows.
Mike
March 27th, 2010, 11:56 PM
Madison, WI
Experience: Advanced
Platform: ALT
Trading: ES
Posts: 625 since Jan 2010
Thanks Given: 356
Thanks Received: 1,127
Call newline function.
March 27th, 2010, 11:57 PM
Manta, Ecuador
Site Administrator Developer Swing Trader
Experience: Advanced
Platform: Custom solution
Broker: IBKR
Trading: Stocks & Futures
Frequency: Every few days
Duration: Weeks
Posts: 50,463 since Jun 2009
Thanks Given: 33,239
Thanks Received: 101,662
aslan
Can you give an example, because this doesn't work as I mentioned...
Code
Text_SetString ( pnltext , text ( " Last: " , positionprofit ( 1 ), NewLine , " / Today: " , todaynet , " " ));
Thx!
Mike
March 28th, 2010, 12:01 AM
Madison, WI
Experience: Advanced
Platform: ALT
Trading: ES
Posts: 625 since Jan 2010
Thanks Given: 356
Thanks Received: 1,127
Try:
Text_SetString(pnltext, text(" Last: ", positionprofit(1), NewLine + " / Today: ", todaynet, " "));
When you have adjacent strings, you use the "+' instead of ",".
March 28th, 2010, 12:15 AM
Madison, WI
Experience: Advanced
Platform: ALT
Trading: ES
Posts: 625 since Jan 2010
Thanks Given: 356
Thanks Received: 1,127
I am not sure this will work.
You can have multi-line text on charts, but I suspect that when you add a text string via code, it will strip out the newlines. I went back to look at some of my old code, and I always placed two text objects to get the effect you are looking for.
The doc does not say you can or can not have multi line text objects, but I have not been able to get it to work with a quick attempt.
March 28th, 2010, 05:04 AM
Manta, Ecuador
Site Administrator Developer Swing Trader
Experience: Advanced
Platform: Custom solution
Broker: IBKR
Trading: Stocks & Futures
Frequency: Every few days
Duration: Weeks
Posts: 50,463 since Jun 2009
Thanks Given: 33,239
Thanks Received: 101,662
Agree, it doesn't work. :puke :
The problem with two separate Text_New's is the chart scaling . I don't know how to properly space them (Close +/- xx ticks) because the chart scaling is always going to be different from day to day.
Hmm.
Mike
March 28th, 2010, 08:30 AM
USA
Posts: 3 since Feb 2010
Thanks Given: 2
Thanks Received: 1
Mike if you split them maybe you can try to use a text_float function also look at
getappinfo
aiLowestDispValue
aiHighestDispValue
TS SUPPORT :: View topic - Can this be done with [AUTOLINK]EasyLanguage[/AUTOLINK]/PowerLanguage ?
here is text_float function . . .
Code
inputs:
TextID( numericsimple ),
TextBarsBack( numericsimple ),
TextPriceValuePercent( numericsimple ) ;
variables:
var0( false ),
var1( 0 ),
var2( 0 ),
var3( 0 ) ;
if LastBarOnChart then
begin
var0 = Text_Exist( TextID ) ;
if var0 then
begin
var1 = GetAppInfo( aiHighestDispValue ) ;
var2 = GetAppInfo( aiLowestDispValue ) ;
var3 = var2 + 0.01 * TextPriceValuePercent *
( var1 - var2 ) ;
Text_SetLocation( TextID, Date[TextBarsBack], Time[TextBarsBack],
var3 ) ;
Text_SetStyle( TextID, 2, 2 ) ;
end
else
RaiseRunTimeError( "TextID does not exist." ) ;
end ;
Text_Float = 1 ;
-----------------------------------------------------------------------------------------------------
Here is an example of text and text_setlocation from medplex. little different than what you wanted but may help in future projects.
Tutorial 42 | Drawing lines and text on a chart
Last Updated on March 28, 2010