Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now for Free
Genuine reviews from real traders, not fake reviews from stealth vendors
Quality education from leading professional traders
We are a friendly, helpful, and positive community
We do not tolerate rude behavior, trolling, or vendors advertising in posts
We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community. It's free for basic access, or support us by becoming an Elite Member -- see if you qualify for a discount below.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
Hi @dwemini, maybe you can use the strategy wizard for what you are trying to do.
I did this and with it. Find attached as a strategy(sorry don't know how to make an indicator out of it)
Maybe one of the generous members here will help you out if it is doing what you want.
I just told the wizard to outline the candles (you can tell it to color the outline, the candle,the bkground, etc) when the RSI was greater than the value of 70.(did not do for undersold)
I am the farthest thing from a coder, just thought would give a shot with the wizard.
There are a bunch of color bar indicators on futures.io (formerly BMT), All one needs do is a search. But I think he wants ready-mix. All one really have to do is to change one line of your code; change "Strategy" to "Indicator " for public class and recompile it.
Cheers!
#region Using declarations
using System;
using System.ComponentModel;
using System.Diagnostics;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Xml.Serialization;
using NinjaTrader.Cbi;
using NinjaTrader.Data;
using NinjaTrader.Indicator;
using NinjaTrader.Gui.Chart;
using NinjaTrader.Strategy;
#endregion
// This namespace holds all strategies and is required. Do not change it.
namespace NinjaTrader.Indicator
{
/// <summary>
/// Enter the description of your strategy here
/// </summary>
[Description("Enter the description of your strategy here")]
public class Rsiobos : Indicator
{
#region Variables
// Wizard generated variables
// User defined variables (add any user defined variables below)
#endregion
/// <summary>
/// This method is used to configure the strategy and is called once before any strategy method is called.
/// </summary>
protected override void Initialize()
{
CalculateOnBarClose = true;
}
/// <summary>
/// Called on each bar update event (incoming tick)
/// </summary>
protected override void OnBarUpdate()
{
// Condition set 1
if (RSI(14, 3).Avg[0] >= 75)
{
CandleOutlineColor = Color.DarkBlue;
}
if (RSI(14, 3).Avg[0] <= 25)
{
CandleOutlineColor = Color.DarkRed;
}
LOL Hi @aligator thanks for that little trick. However when I tried to just replace "Strategy" with "Indicator"
got compile error, so opened a regular indicator in editor and copied and pasted this
" NinjaTrader.Indicator.Indicator" and it compiled.(if this was not right way, please shout out)
Really cool, now I know how to create a strategy and then make into indicator. Your tip is much appreciated, you have created a monster-LOL.
Not really I still have no clue but now I can really screw my install up with badly coded indis-Thanks! lol.
On a serious note I really appreciate you chiming in with the "how-to" Thanks-All the best
edit: ok now totally confused I for curiosity copied and pasted your above code and it compiles. Think I am missing something cause when all I did was use the Strategy and edited it and replaced the one word "strategy" with "indicator" it did not work until I used the " NinjaTrader.Indicator.Indicator" in place of "strategy" yet when I used your code all was fine and it compiled. Sorry for rambling guess thinking out loud on paper but for all to see.
Don't be confused, that is the trick Just create a simple strategy and copy the code area (parameters, Initilization, OnBarUpdate, Properties,etc. (but none of the NinjaScript Generated Code) into a new indicator. I do the same, then I just add whatever bells and whistles I want.
You are more than welcome! Not a monster, just a fisherman now..
Great post, love that you're having a go at it yourself. You can learn so much from pattern matching and adding functionality..and there are always friendly people to help here.
Have just noticed this thread today, so I´m likely a bit late to the party...
A while back , I´ve created an RSI which does what you want and more. You can define up to five levels and color the bars accordingly. It has also options to display arrows and play sound alerts at OB/OS conditions. I´m attaching the RSIpaintBarsDeLuxe2 in case you or someone else is interested.