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 10,562 views
    2. thumb_up 1 thanks given
    3. group 3 followers
    1. forum 9 posts
    2. attach_file 0 attachments




 
Search this Thread
  #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
Frequency: Every few days
Duration: Weeks
Posts: 50,669 since Jun 2009
Thanks Given: 33,669
Thanks Received: 102,583

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
Searching for trading reviews? Review this list
Lifetime Elite Membership: Sign-up for only $149 USD
Exclusive money saving offers from our Site Sponsors: Browse Offers
Report problems with the site: Using the NexusFi changelog thread
Follow me on X Visit my NexusFi Trade Journal Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Strike Pause Holds, Oil Erases Monday Spike -- May CPI W …
Traders Hideout
The May 31 Binary: 60% Trump Declares Iran Ops Over, Onl …
Prediction Markets & Event Contracts
June 15 Peace Odds Surge From 3.6% to 12.25% After Trump …
Prediction Markets & Event Contracts
Wood Mackenzie Drops $200 Oil Forecast -- Airspace Expir …
Prediction Markets & Event Contracts
Iran Deal "In Review" at 87% on Deadline Day - …
Prediction Markets & Event Contracts
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Big Mike in Ecuador
196 thanks
Sober Journey With S&P
27 thanks
30 Sessions
20 thanks
Volume Indicators
8 thanks
BERN ALGOS algo trading journal
8 thanks
  #3 (permalink)
 
cory's Avatar
 cory 
virginia
 
Experience: Intermediate
Platform: ninja
Trading: NQ
Posts: 6,099 since Jun 2009
Thanks Given: 877
Thanks Received: 8,098


time to try out that legendary MC support.


Reply With Quote
  #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
Frequency: Every few days
Duration: Weeks
Posts: 50,669 since Jun 2009
Thanks Given: 33,669
Thanks Received: 102,583


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
Searching for trading reviews? Review this list
Lifetime Elite Membership: Sign-up for only $149 USD
Exclusive money saving offers from our Site Sponsors: Browse Offers
Report problems with the site: Using the NexusFi changelog thread
Follow me on X Visit my NexusFi Trade Journal Started this thread Reply With Quote
  #5 (permalink)
 
aslan's Avatar
 aslan 
Madison, WI
 
Experience: Advanced
Platform: ALT
Trading: ES
Posts: 624 since Jan 2010
Thanks Given: 356
Thanks Received: 1,129

Call newline function.


Reply With Quote
  #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
Frequency: Every few days
Duration: Weeks
Posts: 50,669 since Jun 2009
Thanks Given: 33,669
Thanks Received: 102,583


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
Searching for trading reviews? Review this list
Lifetime Elite Membership: Sign-up for only $149 USD
Exclusive money saving offers from our Site Sponsors: Browse Offers
Report problems with the site: Using the NexusFi changelog thread
Follow me on X Visit my NexusFi Trade Journal Started this thread Reply With Quote
  #7 (permalink)
 
aslan's Avatar
 aslan 
Madison, WI
 
Experience: Advanced
Platform: ALT
Trading: ES
Posts: 624 since Jan 2010
Thanks Given: 356
Thanks Received: 1,129

Try:

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

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


Reply With Quote
  #8 (permalink)
 
aslan's Avatar
 aslan 
Madison, WI
 
Experience: Advanced
Platform: ALT
Trading: ES
Posts: 624 since Jan 2010
Thanks Given: 356
Thanks Received: 1,129

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
Thanked by:
  #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
Frequency: Every few days
Duration: Weeks
Posts: 50,669 since Jun 2009
Thanks Given: 33,669
Thanks Received: 102,583

Agree, it doesn't work.

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
Searching for trading reviews? Review this list
Lifetime Elite Membership: Sign-up for only $149 USD
Exclusive money saving offers from our Site Sponsors: Browse Offers
Report problems with the site: Using the NexusFi changelog thread
Follow me on X Visit my NexusFi Trade Journal Started this thread Reply With Quote
  #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 EasyLanguage/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


© 2026 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 - Downloads - Top
no new posts