PlotColors Code for NT7 - NinjaTrader | futures io social day trading
futures io futures trading


PlotColors Code for NT7
Updated: Views / Replies:3,168 / 13
Created: by jharthun Attachments:3

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

PlotColors Code for NT7

  #1 (permalink)
Elite Member
Hacienda Heights, California
 
Futures Experience: Beginner
Platform: NinjaTrader & MetaStock
Broker/Data: NinjaTrader Brokerage
Favorite Futures: ES, CL, NG
 
jharthun's Avatar
 
Posts: 36 since Jul 2009
Thanks: 8 given, 21 received

PlotColors Code for NT7

I have a colored plot that crosses a zero line. The colors do not change exactly at the zero line. How should this be coded to change exactly at the zero line?

if (Plot[0]>0) PlotColors[0][0] = UpColor;
if (Plot[0]<0) PlotColors[0][0] = DownColor;

I would also like the zero line and other lines to draw on top of a histogram instead of behind. Is that possible?

Reply With Quote
 
  #2 (permalink)
Quick Summary
Quick Summary Post

Quick Summary is created and edited by users like you... Add FAQ's, Links and other Relevant Information by clicking the edit button in the lower right hand corner of this message.

 
  #3 (permalink)
Elite Member
Berlin, Europe
 
Futures Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker/Data: Interactive Brokers
Favorite Futures: Keyboard
 
Fat Tails's Avatar
 
Posts: 9,653 since Mar 2010
Thanks: 4,226 given, 25,602 received
Forum Reputation: Legendary



jharthun View Post
I have a colored plot that crosses a zero line. The colors do not change exactly at the zero line. How should this be coded to change exactly at the zero line?

if (Plot[0]>0) PlotColors[0][0] = UpColor;
if (Plot[0]<0) PlotColors[0][0] = DownColor;

I would also like the zero line and other lines to draw on top of a histogram instead of behind. Is that possible?

Best attach a sample, so we can modify it.

If you want to plot the zeroline and other lines on top of a histogram, this is possible but not easy. You need to use ZOrder, and code two indicators.

Use one indicator for the histogram, select Zorder = x (for example ZOrder = 2) in the Initialize() section of the indicator.
Use another indicator for the zerolines, select ZOrder = x+1 (for example ZOrder = 3) in the Initialize() section of the indicator.

As far as I know, it is not possible to code this within a single indicator.



where x stands for a number such as 2

Reply With Quote
 
  #4 (permalink)
 Vendor: www.integrity-traders.com 
East Rochester, NY
 
Futures Experience: Intermediate
Platform: NT
 
eDanny's Avatar
 
Posts: 327 since Jul 2009
Thanks: 17 given, 419 received

Post the code and I'll fix you up.

Reply With Quote
 
  #5 (permalink)
Elite Member
Berlin, Europe
 
Futures Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker/Data: Interactive Brokers
Favorite Futures: Keyboard
 
Fat Tails's Avatar
 
Posts: 9,653 since Mar 2010
Thanks: 4,226 given, 25,602 received
Forum Reputation: Legendary


eDanny View Post
Post the code and I'll fix you up.

Do you have a solution for the problem to draw one element on top of another within the same indicator? For example, woud it be possible to draw a rectangle via DrawRectangle() behind a plotted line?

Reply With Quote
 
  #6 (permalink)
Elite Member
Hacienda Heights, California
 
Futures Experience: Beginner
Platform: NinjaTrader & MetaStock
Broker/Data: NinjaTrader Brokerage
Favorite Futures: ES, CL, NG
 
jharthun's Avatar
 
Posts: 36 since Jul 2009
Thanks: 8 given, 21 received

Hi Fat Tails

I found a solution for drawing a line on top of a histogram. Instead of using Add(Line), I used Add(Plot) and set it to a fixed value. As long as the horizontal line plot comes before the histogram plot, the line draws on top.

Reply With Quote
The following user says Thank You to jharthun for this post:
 
  #7 (permalink)
Trading Apprentice
Willowbrook, IL
 
Futures Experience: None
Platform: Windows 7, Android
Favorite Futures: Mouse and Keyboard
 
tarantino's Avatar
 
Posts: 32 since Sep 2010
Thanks: 71 given, 39 received

Answer
This post has been selected as an answer to the original posters question Answer


Fat Tails View Post
Do you have a solution for the problem to draw one element on top of another within the same indicator? For example, woud it be possible to draw a rectangle via DrawRectangle() behind a plotted line?


protectedoverridevoid OnBarUpdate()
{
IRectangle r = DrawRectangle(
"r", true, CurrentBar, Close[0] - 4 * TickSize, 0, Close[0] + 4 * TickSize, Color.Red, Color.Red, 8);
r.SeparateZOrder =
true;
Value.Set(Close[
0]);
}

It will not allow you to set ZOrder in the code, but at least you can change it with
Shift + Mouse Wheel when on the chart...

Reply With Quote
The following user says Thank You to tarantino for this post:
 
  #8 (permalink)
Elite Member
Berlin, Europe
 
Futures Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker/Data: Interactive Brokers
Favorite Futures: Keyboard
 
Fat Tails's Avatar
 
Posts: 9,653 since Mar 2010
Thanks: 4,226 given, 25,602 received
Forum Reputation: Legendary


tarantino View Post
protectedoverridevoid OnBarUpdate()
{
IRectangle r = DrawRectangle(
"r", true, CurrentBar, Close[0] - 4 * TickSize, 0, Close[0] + 4 * TickSize, Color.Red, Color.Red, 8);
r.SeparateZOrder =
true;
Value.Set(Close[
0]);
}

It will not allow you to set ZOrder in the code, but at least you can change it with
Shift + Mouse Wheel when on the chart...

That is already better than 2 separate indicators that I have used so far. The question is, whether I can save the order as part of my workspace, once I have shifted it to the appropriate level. The chart template does not save it, as far as I know.

Reply With Quote
 
  #9 (permalink)
 Vendor: www.integrity-traders.com 
East Rochester, NY
 
Futures Experience: Intermediate
Platform: NT
 
eDanny's Avatar
 
Posts: 327 since Jul 2009
Thanks: 17 given, 419 received


Fat Tails View Post
Do you have a solution for the problem to draw one element on top of another within the same indicator? For example, woud it be possible to draw a rectangle via DrawRectangle() behind a plotted line?

Yes, the solution is in post #6.

Reply With Quote
 
  #10 (permalink)
Elite Member
Berlin, Europe
 
Futures Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker/Data: Interactive Brokers
Favorite Futures: Keyboard
 
Fat Tails's Avatar
 
Posts: 9,653 since Mar 2010
Thanks: 4,226 given, 25,602 received
Forum Reputation: Legendary



eDanny View Post
Yes, the solution is in post #6.

I have modified the pivots indicator and added 3 lines of code to plot a rectangle as well. The rectangle is plotted in the end of the OnBarUpdate() section.

- I have not yet tried to put DrawRectangle() into the custom plot area, because the custom plot is called with every incoming tick... -

As can be seen below, the rectangle plots above the bars and above the plot lines. If I initialize the indicator with ZOrder = -1, the rectangle will plot behind the bars, but still above the plot lines.

Is there any way to plot the rectangle behind the plot lines?

Attached Thumbnails
PlotColors Code for NT7-tf-12-10-15-min-17_11_2010.jpg  
Attached Files
Register to download File Type: zip RectanglePivots.zip (5.7 KB, 20 views)
Reply With Quote
The following 2 users say Thank You to Fat Tails for this post:

Reply



futures io > > > > PlotColors Code for NT7

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
PlotColors serialization problem - NT7 Al2010 NinjaTrader Programming 8 August 4th, 2015 12:48 PM
DrawDot code not working in NT7..? prisonbreaker82 NinjaTrader Programming 2 June 6th, 2011 12:52 PM
Can someone code this ? skyfly NinjaTrader Programming 8 April 25th, 2011 01:40 PM
code for NT7 volume oscillator euroventure NinjaTrader 2 December 22nd, 2010 12:42 PM
NT7 - code break changes + TRADING LIVE max-td NinjaTrader Programming 9 April 12th, 2010 11:53 AM


All times are GMT -4. The time now is 06:14 AM.

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.15 seconds with 38 queries on phoenix via your IP 54.82.81.154