NexusFi: Find Your Edge


Home Menu

 





Drawing a text on a chart report


Discussion in NinjaTrader

Updated
    1. trending_up 4,247 views
    2. thumb_up 3 thanks given
    3. group 2 followers
    1. forum 11 posts
    2. attach_file 0 attachments




 
Search this Thread

Drawing a text on a chart report

  #11 (permalink)
 
ratfink's Avatar
 ratfink 
Birmingham UK
Market Wizard
 
Experience: Intermediate
Platform: NinjaTrader
Broker: TST/Rithmic
Trading: YM/Gold
Posts: 3,633 since Dec 2012
Thanks Given: 17,423
Thanks Received: 8,426


Astrogirl View Post
Just done it!

The output windows gives me all the values correctly in some current bars (the ones related to the opened position, of course). Infact the strategy works as it due but the row

- DrawText("My text" + CurrentBar, "Stop_loss_price", 0, stop_loss_price, Color.Red);

It doesn't work as no data is drawn on the chart report.

Ok, then next couple of tests:

1) Try changing BarsAgo in the DrawText from 0 to say 10 or 20 (i.e. put it further back in the chart, just in case its always hidden by something)

2) Use the call
 
Code
DrawTextFixed ("TLtext", "Stop_loss_price  " + stop_loss_price, TextPostion.TopLeft);
and you should always see the last stop in the top left hand corner of the chart.

You could also add in the time while testing as well, e.g. use
 
Code
DrawTextFixed ("TRtext", Time[0].ToString(), TextPosition.TopRight);
Note CurrentBar not needed in these cases as the fixed text places always overwrite anyway.

NB Using "My text" + CurrentBar may not guarantee unique drawing items - especially if you make use of cut/copy/paste and forget to edit one, in which case if you are drawing two things with the same 'tag' only the second one will remain visible, I find it better to use a cut down but still related tag construction whether CurrentBar is needed or not.

e.g. instead of "My Text" + CurrentBar, use "Stop Loss" + CurrentBar and then elsewhere "Entry" + CurrentBar or whatever else is more likely to be 'safe'. I mention this as it has caught me out many (grrrr) times.

Travel Well
Visit my NexusFi Trade Journal Reply With Quote
Thanked by:

Can you help answer these questions
from other members on NexusFi?
Pivot Indicator like the old SwingTemp by Big Mike
NinjaTrader
MC PL editor upgrade
MultiCharts
Better Renko Gaps
The Elite Circle
REcommedations for programming help
Sierra Chart
Cheap historycal L1 data for stocks
Stocks and ETFs
 
  #12 (permalink)
Astrogirl
Milan/Italy
 
Posts: 51 since Oct 2013
Thanks Given: 25
Thanks Received: 12

Ratfink your help is great! I used the "Print" command to have results in the output window as you said and that is a great stuff!

The assignment of the stop_loss_price level comes in the actions of a condition group in the {....} and it seems doesn't work; well, when I put the Print command out of the {....} instead, it works!

The question could be: Does a variable be declared in the "if" actions set?

Reply With Quote
Thanked by:




Last Updated on March 27, 2014


© 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