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,359 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() ?

  #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,442 since Jun 2009
Thanks Given: 33,215
Thanks Received: 101,603

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 Twitter Visit my NexusFi Trade Journal Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Exit Strategy
NinjaTrader
PowerLanguage & EasyLanguage. How to get the platfor …
EasyLanguage Programming
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
REcommedations for programming help
Sierra Chart
Better Renko Gaps
The Elite Circle
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Just another trading journal: PA, Wyckoff & Trends
31 thanks
Spoo-nalysis ES e-mini futures S&P 500
29 thanks
Tao te Trade: way of the WLD
24 thanks
Bigger Wins or Fewer Losses?
20 thanks
GFIs1 1 DAX trade per day journal
17 thanks
  #3 (permalink)
 
cory's Avatar
 cory 
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.

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,442 since Jun 2009
Thanks Given: 33,215
Thanks Received: 101,603


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 Twitter 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: 625 since Jan 2010
Thanks Given: 356
Thanks Received: 1,127

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,442 since Jun 2009
Thanks Given: 33,215
Thanks Received: 101,603


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 Twitter 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: 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 ",".

Reply With Quote
  #8 (permalink)
 
aslan's Avatar
 aslan 
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.

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,442 since Jun 2009
Thanks Given: 33,215
Thanks Received: 101,603

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
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 Twitter 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 [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