NexusFi: Find Your Edge


Home Menu

 





OHLC based on previous day's close


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one asf008005 with 4 posts (0 thanks)
    2. looks_two Fat Tails with 4 posts (4 thanks)
    3. looks_3 Quick Summary with 1 posts (0 thanks)
    4. looks_4 cory with 1 posts (1 thanks)
    1. trending_up 5,288 views
    2. thumb_up 5 thanks given
    3. group 3 followers
    1. forum 9 posts
    2. attach_file 2 attachments




 
Search this Thread

OHLC based on previous day's close

  #1 (permalink)
asf008005
Hartford CT
 
Posts: 6 since May 2012
Thanks Given: 6
Thanks Received: 0

Hi,
I'm new to ninjatrader and excited to begin learning the program. I noticed that ninja trader's OHLC bar charts are a little different than others i'm used to. Is there an indicator available that plots each bar according to the previous day's close? As it is now, the bars are colored based on the close versus the open of the same bar. I want them to be colored based on the current close versus the previous day's close.
Thanks all, Andrew

Reply With Quote

Can you help answer these questions
from other members on NexusFi?
What broker to use for trading palladium futures
Commodities
Cheap historycal L1 data for stocks
Stocks and ETFs
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
Better Renko Gaps
The Elite Circle
MC PL editor upgrade
MultiCharts
 
  #3 (permalink)
 
Fat Tails's Avatar
 Fat Tails 
Berlin, Europe
Market Wizard
 
Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker: Interactive Brokers
Trading: Keyboard
Posts: 9,888 since Mar 2010
Thanks Given: 4,242
Thanks Received: 27,103



asf008005 View Post
Hi,
I'm new to ninjatrader and excited to begin learning the program. I noticed that ninja trader's OHLC bar charts are a little different than others i'm used to. Is there an indicator available that plots each bar according to the previous day's close? As it is now, the bars are colored based on the close versus the open of the same bar. I want them to be colored based on the current close versus the previous day's close.
Thanks all, Andrew


The way NinjaTrader colors the bars is needed for candle sticks. Otherwise you would not be able to tell whether a bar that has its full body above or below the prior close is an upclose or downclose.

Many charting programs like TradeStationor MultiCharts have unicolor OHLC bars, others like Wealth Lab follow the rules of candlesticks as NinjaTrader does.

If you need another rule, just code a small indicator and apply it to your chart.

This would be the code for the colors you want to see:

 
Code
private override void Initialize()
{
      CalculateOnBarClose = false;
}

private override void OnBarUpdate()
{
      if (CurrentBar < 1) 
             return;
      if(Close[0] > Close[1])
             BarColor = Color.LimeGreen;
      else if (Close[0] < Close[1])
             BarColor = Color.Red;
      else
             BarColor = Color.Orange;
}


Just edit any indicator, remove all stuff in public class <your indicator name>: Indicator and replace it with the code above. Not tested.

Reply With Quote
Thanked by:
  #4 (permalink)
asf008005
Hartford CT
 
Posts: 6 since May 2012
Thanks Given: 6
Thanks Received: 0

Thanks Fat tails!
Unfortunately, I don't think i'm able to do that in my version. I just joined mirus and downloaded the direct edition. It's not a full license key, and I cant create my own ninjascript strategies. Do you think there is a way around this?

-Andrew

Reply With Quote
  #5 (permalink)
 
Fat Tails's Avatar
 Fat Tails 
Berlin, Europe
Market Wizard
 
Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker: Interactive Brokers
Trading: Keyboard
Posts: 9,888 since Mar 2010
Thanks Given: 4,242
Thanks Received: 27,103

You will need somebody to code the indicator and export it as a zip file. You can then import the indicator with your direct edition.

Have attached the indicator below, just import it. I have not serialized the colors, so you cannot currently select them. Maybe someone will add that code, I can do it as well, but do not have the time now.




Attached Files
Elite Membership required to download: BarColorsOHLC.zip
Reply With Quote
Thanked by:
  #6 (permalink)
asf008005
Hartford CT
 
Posts: 6 since May 2012
Thanks Given: 6
Thanks Received: 0

Wow, thanks a lot fat tails. I loaded your file and it looks good! Changing color isn't a big deal, they match up with my original format. Great work!!

-I forgot about wanting the volume bars to match up as well. I'm assuming its an easy fix, same idea just with volume. Thanks again, happy Memorial Day!
-Andrew

Reply With Quote
  #7 (permalink)
 
Fat Tails's Avatar
 Fat Tails 
Berlin, Europe
Market Wizard
 
Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker: Interactive Brokers
Trading: Keyboard
Posts: 9,888 since Mar 2010
Thanks Given: 4,242
Thanks Received: 27,103


asf008005 View Post
Wow, thanks a lot fat tails. I loaded your file and it looks good! Changing color isn't a big deal, they match up with my original format. Great work!!

-I forgot about wanting the volume bars to match up as well. I'm assuming its an easy fix, same idea just with volume. Thanks again, happy Memorial Day!
-Andrew

Did you try to apply the indicator to volume bars?

Reply With Quote
Thanked by:
  #8 (permalink)
 
cory's Avatar
 cory 
virginia
 
Experience: Intermediate
Platform: ninja
Trading: NQ
Posts: 6,098 since Jun 2009
Thanks Given: 877
Thanks Received: 8,090


asf008005 View Post
Thanks Fat tails!
Unfortunately, I don't think i'm able to do that in my version. I just joined mirus and downloaded the direct edition. It's not a full license key, and I cant create my own ninjascript strategies. Do you think there is a way around this?

-Andrew

@asf008005 send email to support@NinjaTrader.com

here is my email, remember to change to suite your broker;
Hi,
I am with AMP future,
my NT doesn't have AMT feature can you send me the free license with full functionality as Ray said, thanks.

Reply With Quote
Thanked by:
  #9 (permalink)
asf008005
Hartford CT
 
Posts: 6 since May 2012
Thanks Given: 6
Thanks Received: 0

Cory: I just sent them an email, i'll cross my fingers. Thanks
FT: I'm having trouble with that. I'm going into indicators menu, adding a new "BarColorsOHLC", and changing the input series to my VolumeUpDown indicator. I tried using plain VOL as well, but can't seem to get it.

Reply With Quote
  #10 (permalink)
 
Fat Tails's Avatar
 Fat Tails 
Berlin, Europe
Market Wizard
 
Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker: Interactive Brokers
Trading: Keyboard
Posts: 9,888 since Mar 2010
Thanks Given: 4,242
Thanks Received: 27,103



asf008005 View Post
Cory: I just sent them an email, i'll cross my fingers. Thanks
FT: I'm having trouble with that. I'm going into indicators menu, adding a new "BarColorsOHLC", and changing the input series to my VolumeUpDown indicator. I tried using plain VOL as well, but can't seem to get it.

The BarColorsOHLC will not color the VolumeUpDown indicator.

You would have to modify the VolumeUpDown indicator directly. Best you post on this thread



and someone might do it, as it only takes a few minutes.

Reply With Quote
Thanked by:




Last Updated on May 29, 2012


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
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.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts