Drawing a text on a chart report - NinjaTrader | futures io social day trading
futures io futures trading


Drawing a text on a chart report
Updated: Views / Replies:1,679 / 11
Created: by Astrogirl Attachments:0

Welcome to futures io.

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

futures io is the largest futures trading community on the planet, with over 90,000 members. At futures io, our goal has always been and always will be to create a friendly, positive, forward-thinking community where members can openly share and discuss everything the world of trading has to offer. The community is one of the friendliest you will find on any subject, with members going out of their way to help others. Some of the primary differences between futures io and other trading sites revolve around the standards of our community. Those standards include a code of conduct for our members, as well as extremely high standards that govern which partners we do business with, and which products or services we recommend to our members.

At futures io, our focus is on quality education. No hype, gimmicks, or secret sauce. The truth is: trading is hard. To succeed, you need to surround yourself with the right support system, educational content, and trading mentors Ė all of which you can find on futures io, utilizing our social trading environment.

With futures io, you can find honest trading reviews on brokers, trading rooms, indicator packages, trading strategies, and much more. Our trading review process is highly moderated to ensure that only genuine users are allowed, so you donít need to worry about fake reviews.

We are fundamentally different than most other trading sites:
  • We are here to help. Just let us know what you need.
  • We work extremely hard to keep things positive in our community.
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts.
  • We firmly believe in and encourage sharing. The holy grail is within you, we can help you find it.
  • We expect our members to participate and become a part of the community. Help yourself by helping others.

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

Reply
 
Thread Tools Search this Thread
 

Drawing a text on a chart report

  #1 (permalink)
Trading for Fun
Milan/Italy
 
Futures Experience: Intermediate
Platform: NinjaTrader
Favorite Futures: ES, YM, NQ, FDAX
 
Astrogirl's Avatar
 
Posts: 51 since Oct 2013
Thanks: 25 given, 7 received

Drawing a text on a chart report

Hello everybody!

I'm a newbie of NT scripting and I cannot undestand why my script doesn't work as I wish:

 
Code
                    BackColor = Color.YellowGreen;
	            DrawText("My text" + CurrentBar, "Stop loss level", 0, stop_loss_level, Color.Red);

It makes a backcolor on a chart but not a text; does anyone know why?!

Reply With Quote
 
  #2 (permalink)
Elite Member
Birmingham UK
 
Futures Experience: Intermediate
Platform: NinjaTrader
Broker/Data: IG/eSignal
Favorite Futures: Dax
 
ratfink's Avatar
 
Posts: 3,336 since Dec 2012
Thanks: 11,276 given, 7,090 received


Astrogirl View Post
Hello everybody!

I'm a newbie of NT scripting and I cannot undestand why my script doesn't work as I wish:

 
Code
                    BackColor = Color.YellowGreen;
	            DrawText("My text" + CurrentBar, "Stop loss level", 0, stop_loss_level, Color.Red);

It makes a backcolor on a chart but not a text; does anyone know why?!

Cases like this first step is always to put a 'Print ("CB " + CurrentBar + " SLL " + stop_loss_level);' type of statement in and check the output window - what does that show?

Travel Well
Reply With Quote
 
  #3 (permalink)
Trading for Fun
Milan/Italy
 
Futures Experience: Intermediate
Platform: NinjaTrader
Favorite Futures: ES, YM, NQ, FDAX
 
Astrogirl's Avatar
 
Posts: 51 since Oct 2013
Thanks: 25 given, 7 received



ratfink View Post
Cases like this first step is always to put a 'Print ("CB " + CurrentBar + " SLL " + stop_loss_level);' type of statement in and check the output window - what does that show?

Sorry Ratfink, what should it happen? I putted your code row in my script but nothing change on the chart

Reply With Quote
 
  #4 (permalink)
Market Wizard
virginia
 
Futures Experience: Intermediate
Platform: ninja
Favorite Futures: ES
 
cory's Avatar
 
Posts: 5,218 since Jun 2009
Thanks: 628 given, 6,315 received
Forum Reputation: Legendary

try;

stop_loss_level = Low[0]; // add this line
BackColor = Color.YellowGreen;
DrawText("My text" + CurrentBar, "Stop loss level", 0, stop_loss_level, Color.Red);

Reply With Quote
 
  #5 (permalink)
Trading for Fun
Milan/Italy
 
Futures Experience: Intermediate
Platform: NinjaTrader
Favorite Futures: ES, YM, NQ, FDAX
 
Astrogirl's Avatar
 
Posts: 51 since Oct 2013
Thanks: 25 given, 7 received


cory View Post
try;

stop_loss_level = Low[0]; // add this line
BackColor = Color.YellowGreen;
DrawText("My text" + CurrentBar, "Stop loss level", 0, stop_loss_level, Color.Red);

No changes

The output monitor gives me always "0";

What looks more strange is that the output windows gives me also the Position.AvgPrice as "0".


Last edited by Astrogirl; March 26th, 2014 at 05:05 PM.
Reply With Quote
 
  #6 (permalink)
Trading for Fun
Milan/Italy
 
Futures Experience: Intermediate
Platform: NinjaTrader
Favorite Futures: ES, YM, NQ, FDAX
 
Astrogirl's Avatar
 
Posts: 51 since Oct 2013
Thanks: 25 given, 7 received

I declared stop_loss_level in the #region Variables as: double stop_loss_level = 0

 
Code
    public class ComplexYMpeak2 : Strategy
    {
        #region Variables
		

		double stop_loss_level = 0	
		

        #endregion
Could it be the matter?


Last edited by Astrogirl; March 26th, 2014 at 05:02 PM.
Reply With Quote
 
  #7 (permalink)
Elite Member
Birmingham UK
 
Futures Experience: Intermediate
Platform: NinjaTrader
Broker/Data: IG/eSignal
Favorite Futures: Dax
 
ratfink's Avatar
 
Posts: 3,336 since Dec 2012
Thanks: 11,276 given, 7,090 received


Astrogirl View Post
I declared stop_loss_level in the #region Variables as: double stop_loss_level = 0

 
Code
    public class ComplexYMpeak2 : Strategy
    {
        #region Variables
		

		double stop_loss_level = 0	
		

        #endregion
Could it be the matter?

We assumed you were calculating the stop_loss_level from somewhere else it is a persistent variable, if not that will definitely be your problem which is why Prints to the output window are always first port of call to check for valid/invalid assumptions, etc.

Travel Well
Reply With Quote
 
  #8 (permalink)
Trading for Fun
Milan/Italy
 
Futures Experience: Intermediate
Platform: NinjaTrader
Favorite Futures: ES, YM, NQ, FDAX
 
Astrogirl's Avatar
 
Posts: 51 since Oct 2013
Thanks: 25 given, 7 received


ratfink View Post
We assumed you were calculating the stop_loss_level from somewhere else it is a persistent variable, if not that will definitely be your problem which is why Prints to the output window are always first port of call to check for valid/invalid assumptions, etc.

I really don't have any preparation about variables anyway my stop_loss_level is:

 
Code
stop_loss_level = Convert.ToInt32 (Position.AvgPrice * (1 - stop_loss));
But, as it gives me an error in the compilator, I had to declare the stop_loss_level as:

 
Code
double stop_loss_level = 0
Probably I reached the goal in a wrong way.

Reply With Quote
 
  #9 (permalink)
Elite Member
Birmingham UK
 
Futures Experience: Intermediate
Platform: NinjaTrader
Broker/Data: IG/eSignal
Favorite Futures: Dax
 
ratfink's Avatar
 
Posts: 3,336 since Dec 2012
Thanks: 11,276 given, 7,090 received


Astrogirl View Post

Probably I reached the goal in a wrong way.

Looks like you just need to work back with Prints at every stage to prove that average price and stop loss are themselves containing some useful numbers, then you can think more about the drawtext call.

Travel Well
Reply With Quote
The following user says Thank You to ratfink for this post:
 
  #10 (permalink)
Trading for Fun
Milan/Italy
 
Futures Experience: Intermediate
Platform: NinjaTrader
Favorite Futures: ES, YM, NQ, FDAX
 
Astrogirl's Avatar
 
Posts: 51 since Oct 2013
Thanks: 25 given, 7 received



ratfink View Post
Looks like you just need to work back with Prints at every stage to prove that average price and stop loss are themselves containing some useful numbers, then you can think more about the drawtext call.

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.


Last edited by Astrogirl; March 26th, 2014 at 05:58 PM.
Reply With Quote

Reply



futures io > > > > Drawing a text on a chart report

Thread Tools Search this Thread
Search this Thread:

Advanced Search



Upcoming Webinars and Events (4:30PM ET unless noted)

Jigsaw Trading: TBA

Elite only

FuturesTrader71: TBA

Elite only

NinjaTrader: TBA

Jan 18

RandBots: TBA

Jan 23

GFF Brokers & CME Group: Futures & Bitcoin

Elite only

Adam Grimes: TBA

Elite only

Ran Aroussi: TBA

Elite only
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
Drawing lines on chart subpanels ECI Ed NinjaTrader Programming 2 July 4th, 2013 02:58 PM
Chart buttons for drawing tools coding? hector24 NinjaTrader Programming 2 October 20th, 2011 09:44 PM
Drawing trailing stop on chart protrader007 NinjaTrader Programming 6 July 22nd, 2011 01:47 AM
Transferring drawing lines from one chart to another in Ninja spinnybobo NinjaTrader 14 August 9th, 2010 09:26 AM
Indicator with variable Text on Chart Henrik EasyLanguage Programming 6 May 14th, 2010 02:01 PM


All times are GMT -4. The time now is 08:25 PM.

Copyright © 2017 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
Page generated 2017-12-13 in 0.12 seconds with 19 queries on phoenix via your IP 54.160.245.121