NexusFi: Find Your Edge


Home Menu

 





How to insert NewLine in EasyLanguage Text() ?


Discussion in EasyLanguage Programming

Updated
      Top Posters
    1. looks_one Big Mike with 4 posts (0 thanks)
    2. looks_two aslan with 3 posts (1 thanks)
    3. looks_3 TIKITRADER with 2 posts (0 thanks)
    4. looks_4 cory with 1 posts (0 thanks)
    1. trending_up 9,312 views
    2. thumb_up 1 thanks given
    3. group 3 followers
    1. forum 9 posts
    2. attach_file 0 attachments




 
Search this Thread

How to insert NewLine in EasyLanguage Text() ?

(login for full post details)
  #1 (permalink)
 
Big Mike's Avatar
 Big Mike 
Manta, Ecuador
Site Administrator
Developer
Swing Trader
 
Experience: Advanced
Platform: Custom solution
Broker: IBKR
Trading: Stocks & Futures
Posts: 50,248 since Jun 2009
Thanks Given: 33,111
Thanks Received: 101,368

I can't figure it out! I'm sure it's simple but I can't find an example.

 
Code
                            
Text_SetString(pnltexttext("  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

We're here to help: just ask the community or contact our Help Desk

Quick Links: Change your Username or Register as a Vendor


For the best trading education, watch our webinars
Searching for trading reviews? Review this list


Lifetime Elite Membership: Sign-up for only $149 USD
Receive exclusive offers from our Site Sponsors: Browse Offers
Report problems with the site: Using the NexusFi changelog thread
Follow me on Twitter Visit my NexusFi Trade Journal Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
ZombieSqueeze
Platforms and Indicators
Looking for an MQL4 MetaTrader programmer/coder
The Elite Circle
Request for MACD with option to use different MAs for fa …
NinjaTrader
Futures Close-Out Policy
Commodities
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Just another trading journal: PA, Wyckoff & Trends
33 thanks
Daytrading ES & NQ
32 thanks
Battlestations: Show us your trading desks!
30 thanks
Spoo-nalysis ES e-mini futures S&P 500
28 thanks
Retail Trading As An Industry
25 thanks

(login for full post details)
  #3 (permalink)
 
cory's Avatar
 cory 
virginia
the coin hunter
 
Experience: Intermediate
Platform: ninja
Trading: NQ
Posts: 6,096 since Jun 2009
Thanks Given: 877
Thanks Received: 8,086


time to try out that legendary MC support.

Reply With Quote
(login for full post details)
  #4 (permalink)
 
Big Mike's Avatar
 Big Mike 
Manta, Ecuador
Site Administrator
Developer
Swing Trader
 
Experience: Advanced
Platform: Custom solution
Broker: IBKR
Trading: Stocks & Futures
Posts: 50,248 since Jun 2009
Thanks Given: 33,111
Thanks Received: 101,368


cory View Post
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

We're here to help: just ask the community or contact our Help Desk

Quick Links: Change your Username or Register as a Vendor


For the best trading education, watch our webinars
Searching for trading reviews? Review this list


Lifetime Elite Membership: Sign-up for only $149 USD
Receive exclusive offers from our Site Sponsors: Browse Offers
Report problems with the site: Using the NexusFi changelog thread
Follow me on Twitter Visit my NexusFi Trade Journal Started this thread Reply With Quote
(login for full post details)
  #5 (permalink)
 
aslan's Avatar
 aslan 
Madison, WI
 
Experience: Advanced
Platform: ALT
Trading: ES
Posts: 623 since Jan 2010
Thanks Given: 351
Thanks Received: 1,124

Call newline function.

Reply With Quote
(login for full post details)
  #6 (permalink)
 
Big Mike's Avatar
 Big Mike 
Manta, Ecuador
Site Administrator
Developer
Swing Trader
 
Experience: Advanced
Platform: Custom solution
Broker: IBKR
Trading: Stocks & Futures
Posts: 50,248 since Jun 2009
Thanks Given: 33,111
Thanks Received: 101,368


aslan View Post
Call newline function.

Can you give an example, because this doesn't work as I mentioned...

 
Code
                            
Text_SetString(pnltexttext("  Last: "positionprofit(1), NewLine" / Today: "todaynet"  ")); 

Thx!

Mike

We're here to help: just ask the community or contact our Help Desk

Quick Links: Change your Username or Register as a Vendor


For the best trading education, watch our webinars
Searching for trading reviews? Review this list


Lifetime Elite Membership: Sign-up for only $149 USD
Receive exclusive offers from our Site Sponsors: Browse Offers
Report problems with the site: Using the NexusFi changelog thread
Follow me on Twitter Visit my NexusFi Trade Journal Started this thread Reply With Quote
(login for full post details)
  #7 (permalink)
 
aslan's Avatar
 aslan 
Madison, WI
 
Experience: Advanced
Platform: ALT
Trading: ES
Posts: 623 since Jan 2010
Thanks Given: 351
Thanks Received: 1,124

Try:

Text_SetString(pnltext, text(" Last: ", positionprofit(1), NewLine + " / Today: ", todaynet, " "));

When you have adjacent strings, you use the "+' instead of ",".

Reply With Quote
(login for full post details)
  #8 (permalink)
 
aslan's Avatar
 aslan 
Madison, WI
 
Experience: Advanced
Platform: ALT
Trading: ES
Posts: 623 since Jan 2010
Thanks Given: 351
Thanks Received: 1,124

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.

Reply With Quote
The following user says Thank You to aslan for this post:
(login for full post details)
  #9 (permalink)
 
Big Mike's Avatar
 Big Mike 
Manta, Ecuador
Site Administrator
Developer
Swing Trader
 
Experience: Advanced
Platform: Custom solution
Broker: IBKR
Trading: Stocks & Futures
Posts: 50,248 since Jun 2009
Thanks Given: 33,111
Thanks Received: 101,368

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

We're here to help: just ask the community or contact our Help Desk

Quick Links: Change your Username or Register as a Vendor


For the best trading education, watch our webinars
Searching for trading reviews? Review this list


Lifetime Elite Membership: Sign-up for only $149 USD
Receive exclusive offers from our Site Sponsors: Browse Offers
Report problems with the site: Using the NexusFi changelog thread
Follow me on Twitter Visit my NexusFi Trade Journal Started this thread Reply With Quote
(login for full post details)
  #10 (permalink)
TIKITRADER
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

Reply With Quote





Last Updated on March 28, 2010


© 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