How to insert NewLine in EasyLanguage Text() ? - futures io
futures io futures trading



How to insert NewLine in EasyLanguage Text() ?


Discussion in EasyLanguage Programming

Updated by TIKITRADER
      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 6,845 views
    2. thumb_up 1 thanks given
    3. group 3 followers
    1. forum 9 replies
    2. attach_file 0 attachments




Welcome to futures io: the largest futures trading community on the planet, with well over 100,000 members
  • 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 and simple.

-- Big Mike, Site Administrator

(If you already have an account, login at the top of the page)

 
Search this Thread
 

How to insert NewLine in EasyLanguage Text() ?

(login for full post details)
  #1 (permalink)
Site Administrator
Manta, Ecuador
 
Experience: Advanced
Platform: My own custom solution
Trading: Emini Futures
 
Big Mike's Avatar
 
Posts: 48,904 since Jun 2009
Thanks: 31,586 given, 94,529 received

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.



Mike

We're here to help -- just ask

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

Follow us on Twitter, YouTube, and Facebook

Support our community as an Elite Member:
https://futures.io/elite/
Follow me on Twitter Visit my Facebook Visit my futures io Trade Journal Reply With Quote

Can you help answer these questions
from other members on futures io?
Scan by comparing SMAs within 5 mins
ThinkOrSwim
How to place an order where the stop loss price changes when a price is touched
TradeStation
Chart text fixed and move with time
NinjaTrader
FYI plot bug & workaround: changing color or width is delayed 1 bar
EasyLanguage Programming
TOS script
ThinkOrSwim
 
 
(login for full post details)
  #3 (permalink)
the coin hunter
virginia
 
Experience: Intermediate
Platform: ninja
Trading: NQ
 
cory's Avatar
 
Posts: 5,998 since Jun 2009
Thanks: 831 given, 7,832 received


time to try out that legendary MC support.

Reply With Quote
 
(login for full post details)
  #4 (permalink)
Site Administrator
Manta, Ecuador
 
Experience: Advanced
Platform: My own custom solution
Trading: Emini Futures
 
Big Mike's Avatar
 
Posts: 48,904 since Jun 2009
Thanks: 31,586 given, 94,529 received


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

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

Follow us on Twitter, YouTube, and Facebook

Support our community as an Elite Member:
https://futures.io/elite/
Follow me on Twitter Visit my Facebook Visit my futures io Trade Journal Reply With Quote
 
(login for full post details)
  #5 (permalink)
Madison, WI
 
Experience: Advanced
Platform: Sierra Charts, ALT
Trading: ES
 
aslan's Avatar
 
Posts: 616 since Jan 2010
Thanks: 351 given, 1,107 received

Call newline function.

Reply With Quote
 
(login for full post details)
  #6 (permalink)
Site Administrator
Manta, Ecuador
 
Experience: Advanced
Platform: My own custom solution
Trading: Emini Futures
 
Big Mike's Avatar
 
Posts: 48,904 since Jun 2009
Thanks: 31,586 given, 94,529 received


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

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

Follow us on Twitter, YouTube, and Facebook

Support our community as an Elite Member:
https://futures.io/elite/
Follow me on Twitter Visit my Facebook Visit my futures io Trade Journal Reply With Quote
 
(login for full post details)
  #7 (permalink)
Madison, WI
 
Experience: Advanced
Platform: Sierra Charts, ALT
Trading: ES
 
aslan's Avatar
 
Posts: 616 since Jan 2010
Thanks: 351 given, 1,107 received

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)
Madison, WI
 
Experience: Advanced
Platform: Sierra Charts, ALT
Trading: ES
 
aslan's Avatar
 
Posts: 616 since Jan 2010
Thanks: 351 given, 1,107 received

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)
Site Administrator
Manta, Ecuador
 
Experience: Advanced
Platform: My own custom solution
Trading: Emini Futures
 
Big Mike's Avatar
 
Posts: 48,904 since Jun 2009
Thanks: 31,586 given, 94,529 received

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

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

Follow us on Twitter, YouTube, and Facebook

Support our community as an Elite Member:
https://futures.io/elite/
Follow me on Twitter Visit my Facebook Visit my futures io Trade Journal Reply With Quote
 
(login for full post details)
  #10 (permalink)
USA
 
 
Posts: 3 since Feb 2010
Thanks: 2 given, 1 received


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


futures io Trading Community Platforms and Indicators EasyLanguage Programming > How to insert NewLine in EasyLanguage Text() ?


March 28, 2010


Upcoming Webinars and Events
 

Every journal equals ten meals for the hungry

Now
     



Copyright © 2020 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