Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- namespace NinjaTrader.NinjaScript.Indicators
- {
- public class TestRSI : Indicator
- {
- private RSI myRSI;
- protected override void OnStateChange()
- {
- if (State == State.SetDefaults)
- {
- Description = @"Enter the description for your new custom Indicator here.";
- Name = "TestRSI";
- Calculate = Calculate.OnBarClose;
- IsOverlay = true;
- DisplayInDataBox = true;
- DrawOnPricePanel = true;
- DrawHorizontalGridLines = true;
- DrawVerticalGridLines = true;
- PaintPriceMarkers = true;
- ScaleJustification = NinjaTrader.Gui.Chart.ScaleJustification.Right;
- //Disable this property if your indicator requires custom values that cumulate with each new market data event.
- //See Help Guide for additional information.
- IsSuspendedWhileInactive = true;
- }
- else if (State == State.Configure)
- {
- }
- else if (State == State.DataLoaded)
- {
- myRSI = RSI(Close, 20, 5);
- }
- }
- protected override void OnBarUpdate()
- {
- if(CurrentBar < 20) return;
- Print(myRSI[0]);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement