Drawing In Margin - NinjaTrader Programming | futures io social day trading
futures io futures trading

Drawing In Margin
Updated: Views / Replies:3,085 / 2
Created: by zeller4 Attachments:1

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

Thread Tools Search this Thread

Drawing In Margin

  #1 (permalink)
Elite Member
Futures Experience: Intermediate
Platform: NT7
Favorite Futures: CL, NQ, NG
Posts: 456 since Jun 2009
Thanks: 1,360 given, 383 received

Drawing In Margin


The attached partial screenshot of my chart shows the right hand margin with a default width set to 75.

The word "Overbought" in my stochastic plot is drawn there using "DrawTextFixed" - that I know about for this example.

The ECO2New2 has values on the y-axis. I'd like to see a plot with a value in the margin...

I'm trying to find a draw tool that will allow me to draw in the right hand margin with price levels / indicator levels / labels, etc. that will be aligned with a specific y value.

Any help or direction you can give would be much appreciated.

Attached Thumbnails
Drawing In Margin-test.bmp  
Reply With Quote
  #2 (permalink)
Site Administrator
Manta, Ecuador
Futures Experience: Advanced
Platform: My own custom solution
Favorite Futures: E-mini ES S&P 500
Big Mike's Avatar
Posts: 46,336 since Jun 2009
Thanks: 29,452 given, 83,947 received


Look at the MML code as example if needed, around line 700 ish.


Due to time constraints, please do not PM me if your question can be resolved or answered on the forum.

Need help?
1) Stop changing things. No new indicators, charts, or methods. Be consistent with what is in front of you first.
2) Start a journal and post to it daily with the trades you made to show your strengths and weaknesses.
3) Set goals for yourself to reach daily. Make them about how you trade, not how much money you make.
4) Accept responsibility for your actions. Stop looking elsewhere to explain away poor performance.
5) Where to start as a trader? Watch this webinar and read this thread for hundreds of questions and answers.
Help using the forum? Watch this video to learn general tips on using the site.

If you want
to support our community, become an Elite Member.

Reply With Quote
The following user says Thank You to Big Mike for this post:
  #3 (permalink)
Elite Member
Austin, TX
Futures Experience: Advanced
Platform: NT/Matlab
Broker/Data: Interactive Brokers
Favorite Futures: FX majors
sefstrat's Avatar
Posts: 285 since Jun 2009
Thanks: 20 given, 750 received

Here is a static method I use for drawing text.. it chooses the color of text label based on the color of the plot passed the color of the value based on whether it is above/below zero.

You will need to modify it slightly to choose the y value in the way you want, but you may find it useful =)

    public static class Util
        private static StringFormat stringFormat = new StringFormat();
        private static SolidBrush textBrush = new SolidBrush(Color.Black);
        private static System.Drawing.Font textFont = new Font("Arial", 8);
        static Util()
            stringFormat.Alignment = StringAlignment.Far;

      public static void drawValueString(NinjaTrader.Indicator.Indicator ind, Graphics graphics, Rectangle bounds, string plotName, int plotNum, DataSeries series, int boxNum)

            int index = -1;
            int bars = ind.CalculateOnBarClose ? (ind.ChartControl.BarsPainted-2) : (ind.ChartControl.BarsPainted-1);

            if (ind.Bars != null)
                index = ((ind.ChartControl.LastBarPainted-ind.ChartControl.BarsPainted)-1)+bars;
                if (ind.ChartControl.ShowBarsRequired || ((index-ind.Displacement) >= ind.BarsRequired))
                    double val = series.Get(index);
                    string s = plotName+": ";
                    StringBuilder str = new StringBuilder();
                    str.Append((Math.Round(val, 3)).ToString());
                    Color valColor = (val > 0) ? Color.YellowGreen : Color.OrangeRed;
                    textBrush.Color = valColor;
                    Brush b = textBrush;
                    if (plotNum == -1)
                        //do nothing
                    else if (ind.Plots[plotNum] == null)
                        s = "Err: Plot Does not exsit!";
                        b = (ind.Plots[plotNum].Pen.Color == Color.Transparent)
                                ? textBrush
                                : ind.Plots[plotNum].Pen.Brush;
                    graphics.DrawString(s, textFont, b, bounds.X+bounds.Width-37, bounds.Y+bounds.Height-boxNum*20,
                    graphics.DrawString(str.ToString(), textFont, textBrush, bounds.X+bounds.Width-3,
                                        bounds.Y+bounds.Height-boxNum*20, stringFormat);

Here is an example of how its called from indicator

        public override void Plot(Graphics graphics, Rectangle bounds, double min, double max)
            base.Plot(graphics, bounds, min, max);
            if (ColorMode > 0)
                drawColorLine(graphics, bounds, min, max, this.Value, this.PenUp, this.PenDown, this.penTurn, false);
            if (_drawValues)
                Util.drawValueString(this, graphics, bounds, "Value", 0, Value, 1);
                Util.drawValueString(this, graphics, bounds, "delta", -1, dValue, 2);
                Util.drawValueString(this, graphics, bounds, "alpha", -1, alpha, 3);
                Util.drawValueString(this, graphics, bounds, "beta", -1, beta, 4);
                Util.drawValueString(this, graphics, bounds, "Kv", -1, Kv, 5);
                Util.drawValueString(this, graphics, bounds, "dThreshold", -1, dThreshold, 6);
                Util.drawValueString(this, graphics, bounds, "dAvg", -1, _dAvg[0], 7);
how it looks:
Please register on futures.io to view futures trading content such as post attachment(s), image(s), and screenshot(s).

Reply With Quote
The following 4 users say Thank You to sefstrat for this post:


futures io > > > > > Drawing In Margin

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

Wyckoff Hunting for Great Risk/Reward Ratio w/Gary Fullett

Elite only

Digging into the Details of iSystems w/Stage 5 & iSystems

Jun 5

Similar Threads
Thread Thread Starter Forum Replies Last Post
Margin requirement changes Big Mike Reviews of Brokers and Data Feeds 20 September 24th, 2011 01:48 AM
Drawing trailing stop on chart protrader007 NinjaTrader Programming 6 July 22nd, 2011 12:47 AM
symbols and margin johni MultiCharts 1 July 9th, 2011 03:45 PM
Price bars drawing behind indicators rsi77 NinjaTrader Programming 3 July 14th, 2010 01:53 AM
drawing Fib lines emini_Holy_Grail Traders Hideout 4 January 15th, 2010 05:43 PM

All times are GMT -4. The time now is 12:32 AM.

Copyright © 2018 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 2018-05-26 in 0.08 seconds with 20 queries on phoenix via your IP