Explanation somewhere on creating custom plots with colors etc...... - NinjaTrader Programming | futures io social day trading
futures io futures trading


Explanation somewhere on creating custom plots with colors etc......
Updated: Views / Replies:3,698 / 13
Created: by forrestang Attachments:6

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
 6  
 
Thread Tools Search this Thread
 

Explanation somewhere on creating custom plots with colors etc......

  #11 (permalink)
Urban Samurai
Chicago IL
 
Futures Experience: Intermediate
Platform: Ninja, MT4,TOS, SC, Matlab
Broker/Data: CQG, AMP, MB, DTN
Favorite Futures: E/U, G/U
 
forrestang's Avatar
 
Posts: 1,039 since Jun 2010
Thanks: 226 given, 688 received


forrestang View Post
I've made some headway with using:

 
Code
public override void Plot()
Is it possible to pass variables into this function from my main program?

The answer is YES! Although indirectly.

The variables created in main function declared globally are available to that function.

Also, if you have this in a separate study as I do, .... you can first capture into the main body of script any variables from OTHER studies, and then those variables are available to the void plot() function.

Woot!


Last edited by forrestang; September 8th, 2011 at 09:52 AM.
Reply With Quote
 
  #12 (permalink)
 Vendor: www.edevaay.com 
Al,India
 
Futures Experience: Advanced
Platform: NinjaTrader
Broker/Data: RKG
Favorite Futures: NiftyFuture
 
devdas's Avatar
 
Posts: 1,547 since Feb 2010
Thanks: 1,460 given, 1,661 received


forrestang View Post
The answer is YES! Although indirectly.

The variables created in main function declared globally are available to that function.

Also, if you have this in a separate study as I do, .... you can first capture into the main body of script any variables from OTHER studies, and then those variables are available to the void plot() function.

Woot!

glad...ur getting interest.
about aligning text in graphics in different lines...there are string formats and you can get the hieght of text to be displayed to offset next line.

yes can have globals to transport values...but recently i stuck with graphics plot.....could not retain values
outside the Plot scope as opposite to other methods. It was very frustrating excercise to get values derived
inside graphics plot to outside. Hope some more experienced coder help me out.


 
Code
 
public override void Plot(Graphics graphics,Rectangle bounds,double min,double max)
{
 
mymin = min;                    // mymin Global variable.
Print(mymin.ToString());   // works only if remains as long as in Plot. Losses value
}                                      // outside the plot.


Harvest The Moon
Nest The Market
Reply With Quote
 
  #13 (permalink)
Urban Samurai
Chicago IL
 
Futures Experience: Intermediate
Platform: Ninja, MT4,TOS, SC, Matlab
Broker/Data: CQG, AMP, MB, DTN
Favorite Futures: E/U, G/U
 
forrestang's Avatar
 
Posts: 1,039 since Jun 2010
Thanks: 226 given, 688 received


@devdas

If you wanted to add the textbrush as a user input so that you could change the colors, how do you go about doing that?

Reply With Quote
 
  #14 (permalink)
 Vendor: www.edevaay.com 
Al,India
 
Futures Experience: Advanced
Platform: NinjaTrader
Broker/Data: RKG
Favorite Futures: NiftyFuture
 
devdas's Avatar
 
Posts: 1,547 since Feb 2010
Thanks: 1,460 given, 1,661 received


forrestang View Post
@devdas

If you wanted to add the textbrush as a user input so that you could change the colors, how do you go about doing that?


this is simple and similar to other variables. Look following changes should be made in script.

1) Declare your text brush without initialisation and add another variable for color.

 
Code
 
#region Variables
.........................
private  System.Drawing.Brush   textbrush;    // no initialization of Brush
private  Color   textcolor;                                 // variable for color.
..........................
#endregion
2) Initialize TextBrush where u need and dispose after use.

 
Code
 
public override void Plot(Graphics graphics, Rectangle bounds, double min, double max)
{
............................
textbrush = new SolidBrush(textcolor);        // initialize here
.......................
.......................
.......................
textbrush.Dispose();                                    // dispose after use.
 }

3) Make provision for this in Properties...so that it could be shown for input.( Important)

 
Code
 
#region Properties
[Description("Select Text Color")]
[Category("Colors")]
[Gui.Design.DisplayName("Text Color")]
public Color Textcolor
{
get { return textcolor; }
set { textcolor = value; }
}
#endregion
and you are done...

Harvest The Moon
Nest The Market
Attached Thumbnails
Explanation somewhere on creating custom plots with colors etc......-colorselection.png  
Reply With Quote
The following 3 users say Thank You to devdas for this post:

Reply



futures io > > > > > Explanation somewhere on creating custom plots with colors etc......

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
Looking for indicator that plots Volume POC forrestang NinjaTrader 20 October 15th, 2015 02:45 AM
Trouble with multiple plots on an indicator eddd NinjaTrader Programming 3 May 31st, 2011 04:45 PM
Ninjatrader indicators without plots jstnbrg NinjaTrader 6 March 2nd, 2011 02:14 AM
MACD_Zero Lag Indicator Explanation GilR NinjaTrader 4 February 25th, 2011 07:36 AM
Null Plots kenz987 NinjaTrader Programming 7 May 10th, 2010 11:29 PM


All times are GMT -4. The time now is 01:53 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-17 in 0.08 seconds with 20 queries on phoenix via your IP 54.226.113.250