DrawRegion between MAs - Color between bars? - help required - NinjaTrader Programming | futures io social day trading
futures io futures trading


DrawRegion between MAs - Color between bars? - help required
Updated: Views / Replies:849 / 5
Created: by techoli Attachments:5

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
 

DrawRegion between MAs - Color between bars? - help required

  #1 (permalink)
Elite Member
Nelson, New Zealand
 
Futures Experience: Intermediate
Platform: NT
Favorite Futures: FDAX, ES
 
Posts: 33 since Mar 2013
Thanks: 13 given, 49 received

DrawRegion between MAs - Color between bars? - help required

Hey guys,


I'm relatively new to coding etc and have made the attached indicator.


It's a wave based on 2 moving averages that uses DrawRegion to color it self (Up/Down/Flat).
if (angleCheck >= slope*.1*TickSize)
{DrawRegion("DrawRegion"+CurrentBar,1, 0, maWaveFast, maWaveSlow, Color.Transparent, upColour, opacity);
}
if (angleCheck <= -slope*.1*TickSize)
{
DrawRegion("DrawRegion"+CurrentBar,1, 0, maWaveFast, maWaveSlow, Color.Transparent, downColour, opacity);
}
if (angleCheck < slope*.1*TickSize && angleCheck > -slope*.1*TickSize)
{
DrawRegion("DrawRegion"+CurrentBar,1, 0, maWaveFast, maWaveSlow, Color.Transparent, flatColour, opacity);
}

If you refer to the attached image: "Example.jpg"
*You can see that the coloring starts in the middle of candle A and colors to candle B.
*I would like the candle coloring to start where 'A' is, however finish where line 'C' is. "Eg; color between bars not on the actual bar" (a second example of how I'd like to do the coloring is in attachment: Example2.jpg -- based on where- where the vertical lines are)


I thought it may be able to be done somehow with:
"ChartControl.GetXByBarIdx(Bars, CurrentBar) - (ChartControl.BarSpace/2)"

However, I am not sure where to being etc.


Is anyone able to please assist me with this? would be greatly appreciated


Thanks,
Techoli

Attached Thumbnails
DrawRegion between MAs - Color between bars? - help required-example.jpg   DrawRegion between MAs - Color between bars? - help required-example-2.jpg  
Attached Files
Register to download File Type: cs _J_Wave.cs (14.3 KB, 10 views)
Reply With Quote
The following user says Thank You to techoli for this post:
 
  #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)
Banned: trolling
NYC + NY / USA
 
Futures Experience: Advanced
Platform: "I trade, therefore, I AM!"; Theme Song: "Atomic Dog!"
Favorite Futures: EMD, 6J, ZB
 
kronie's Avatar
 
Posts: 798 since Oct 2009
Thanks: 216 given, 498 received



techoli View Post
Hey guys,


I'm relatively new to coding etc and have made the attached indicator.


It's a wave based on 2 moving averages that uses DrawRegion to color it self (Up/Down/Flat).
if (angleCheck >= slope*.1*TickSize)
{DrawRegion("DrawRegion"+CurrentBar,1, 0, maWaveFast, maWaveSlow, Color.Transparent, upColour, opacity);
}
if (angleCheck <= -slope*.1*TickSize)
{
DrawRegion("DrawRegion"+CurrentBar,1, 0, maWaveFast, maWaveSlow, Color.Transparent, downColour, opacity);
}
if (angleCheck < slope*.1*TickSize && angleCheck > -slope*.1*TickSize)
{
DrawRegion("DrawRegion"+CurrentBar,1, 0, maWaveFast, maWaveSlow, Color.Transparent, flatColour, opacity);
}

If you refer to the attached image: "Example.jpg"
*You can see that the coloring starts in the middle of candle A and colors to candle B.
*I would like the candle coloring to start where 'A' is, however finish where line 'C' is. "Eg; color between bars not on the actual bar" (a second example of how I'd like to do the coloring is in attachment: Example2.jpg -- based on where- where the vertical lines are)


I thought it may be able to be done somehow with:
"ChartControl.GetXByBarIdx(Bars, CurrentBar) - (ChartControl.BarSpace/2)"

However, I am not sure where to being etc.


Is anyone able to please assist me with this? would be greatly appreciated


Thanks,
Techoli


when you choose Export ninja indicator, it creates a zip file version of the indicator

Reply With Quote
 
  #4 (permalink)
Elite Member
Nelson, New Zealand
 
Futures Experience: Intermediate
Platform: NT
Favorite Futures: FDAX, ES
 
Posts: 33 since Mar 2013
Thanks: 13 given, 49 received

Sorry, yes, I didn't notice that I uploaded the cs file. I have attached the .zip version.


Fat Tails recommended that I try the TriggerLines indicator. I had a look at that one and the coloring aligns with the candles still.

My goal is to color the wave in-between candles. I hand-made a picture of what I'm trying to achieve regarding the coloring between candles (attached). I think this is done by overriding plot. However, no idea where to start.

Attached Thumbnails
DrawRegion between MAs - Color between bars? - help required-coloring.jpg  
Attached Files
Register to download File Type: zip J_Wave.zip (9.9 KB, 21 views)
Reply With Quote
 
  #5 (permalink)
Elite Member
Cedar Rapids, iowa
 
Futures Experience: Intermediate
Platform: Ninjatrader
Broker/Data: Ninjatrader - Continuum
Favorite Futures: 6E, TF, 6J
 
Tasker_182's Avatar
 
Posts: 626 since Aug 2009
Thanks: 426 given, 1,126 received


techoli View Post
Sorry, yes, I didn't notice that I uploaded the cs file. I have attached the .zip version.


Fat Tails recommended that I try the TriggerLines indicator. I had a look at that one and the coloring aligns with the candles still.

My goal is to color the wave in-between candles. I hand-made a picture of what I'm trying to achieve regarding the coloring between candles (attached). I think this is done by overriding plot. However, no idea where to start.


Another option (untested by me) may be to add another data series at twice the sampling rate (IE: if main series 1 minute candle, add 30 second candles), hide the added data series by setting it to line on close and turning the line color then to transparent (make sure to overlay as well in same panel). Then using your logic on the main data series to determine the colors, actuate the drawregion using the secondary series which should have candles between your main series.

"Money is better than poverty, if only for financial reasons." - Woody Allen
Reply With Quote
 
  #6 (permalink)
Elite Member
Nelson, New Zealand
 
Futures Experience: Intermediate
Platform: NT
Favorite Futures: FDAX, ES
 
Posts: 33 since Mar 2013
Thanks: 13 given, 49 received


Tasker_182 View Post
Another option (untested by me) may be to add another data series at twice the sampling rate (IE: if main series 1 minute candle, add 30 second candles), hide the added data series by setting it to line on close and turning the line color then to transparent (make sure to overlay as well in same panel). Then using your logic on the main data series to determine the colors, actuate the drawregion using the secondary series which should have candles between your main series.


I'll give that a shot, also will try a couple other ideas and let you know how i progress.

Reply With Quote
The following user says Thank You to techoli for this post:

Reply



futures io > > > > > DrawRegion between MAs - Color between bars? - help required

Thread Tools Search this Thread
Search this Thread:

Advanced Search



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

Linda Bradford Raschke: Reading The Tape

Elite only

Adam Grimes: TBA

Elite only

NinjaTrader: TBA

January

Ran Aroussi: TBA

Elite only
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
Using DrawRegion to shade between two data series FBJS NinjaTrader Programming 6 March 6th, 2014 09:05 PM
Can Ninja Drawregion do other than solid fill? tulanch NinjaTrader 1 April 27th, 2013 08:10 AM
DrawRegion with Swing indicator Azzzz NinjaTrader Programming 2 June 7th, 2011 05:24 PM
If MUCH is given MUCH is required rfharris Trading Journals 7 September 28th, 2010 03:08 PM
IF MUCH is given MUCH is required rfharris Trading Journals 2 September 28th, 2010 02:55 PM


All times are GMT -4. The time now is 11:21 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-11 in 0.11 seconds with 20 queries on phoenix via your IP 54.82.81.154