Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Option to change color of signal

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Option to change color of signal

    I used the strategy builder to create this indicator but I'm having trouble figuring out how to get the plotted arrow so I can change the color. I must say I'm a complete novice at this. Any help would be greatly appreciated.
    Thank you for your time.

    namespace NinjaTrader.NinjaScript.Indicators
    {
    public class test3indicator : Indicator
    {
    private NinjaTrader.NinjaScript.Indicators.GomPro.GomOrder FlowProValues GomOrderFlowProValues1;

    protected override void OnStateChange()
    {
    if (State == State.SetDefaults)
    {
    Description = @"Enter the description for your new custom Indicator here.";
    Name = "test3indicator";
    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;
    AddPlot(new Stroke(Brushes.DarkGreen, 2), PlotStyle.TriangleUp, "UpSignal");
    AddPlot(new Stroke(Brushes.Red, 2), PlotStyle.TriangleDown, "DownSignal");


    }
    else if (State == State.Configure)
    {
    }
    else if (State == State.DataLoaded)
    {
    GomOrderFlowProValues1 = GomOrderFlowProValues(Close, Gom.DeltaLib.DeltaCalcType.BidAsk, false, -1, 0, 2, Gom.OrderFlow.ImbalanceDirectionType.Diagonal, Gom.OrderFlow.ImbalanceComparisonType.Ratio, 3, Gom.OrderFlow.ImbalanceDirectionType.None, Gom.OrderFlow.ImbalanceComparisonType.Difference, 3, 0, 1, -1, 2, 100, 3, false, 0, Gom.OrderFlow.ReversalPocPositionType.Anywhere, false, false);

    }
    }

    protected override void OnBarUpdate()
    {
    //Add your custom indicator logic here.
    if
    // Aggressive Buyers
    (GomOrderFlowProValues1.NbBuyImbalances[0] >= 3)
    {

    Draw.TriangleUp(this, @"UpSignal" + Convert.ToString(CurrentBars[0]), false, 0, (Low[0] - 7) , Brushes.Lime);
    }
    }

    #region Properties

    [Browsable(false)]
    [XmlIgnore]
    public Series<double> UpSignal
    {
    get { return Values[0]; }
    }

    [Browsable(false)]
    [XmlIgnore]
    public Series<double> DownSignal
    {
    get { return Values[1]; }
    }
    #endregion

    }

    #2
    Hello laoshr,

    Thanks for your post.

    In order to see a plot, you would need to assign a value (In OnBarUpdate) that identifies to the plot where on the Y axis (Price scale) to plot it.

    For example:

    UpSignal[0] = Low[0] - 10 * TickSize; // plot darkgreen triangle 10 ticks below the 10 of the current bar.

    Comment


      #3
      Hello, Paul.
      Thank you for your reply. I got the UpSignal to plot but it is not plotted on the low of the bar. It is on the x-axis but is stuck to the bottom or the top of the screen.

      Comment


        #4
        Hello laoshr,

        Thanks for your reply.

        Please post your update code and a screenshot of your chart that shows the complete chart (so I can see instrument, bar type, price scale and time base)

        Comment


          #5
          Hello Paul,
          I did get this to work with the basic code I posted. But when I used the same code on the indicator I'm trying to develop it still sticking the signal to the bottom and top of the screen. I went through and the logic is all in the same places and with the correct references.

          The dark grey is correct from the simple code posted above. The chartreuse is stuck to the top and bottom of the chart and those are the ones in the main indicator being developed.
          I can post that script but it is very big.

          Let me know if you would like me to post the whole script of the indicator being developed? I would want to delete the script so it isn't left on the forum.
          Thank you.
          James



          Attached Files

          Comment


            #6
            Hello James,

            Thanks for your reply.

            Can you post the code that shows the values being assigned to the two plots?


            Comment


              #7
              I just want to say thank you for your patience. I added screenshots of the areas where the code for the plots are. Let me know if you see anything out of sorts.
              Thank you again, Paul
              Attached Files

              Comment


                #8
                Hello laoshr,

                Thanks for your reply.

                It looks like you are using my example to assign the value to only one plot (SlingBuy). The value is being assigned 10 ticks below the low of the current price. You can set it to be any price-based value you wish, you can set it to less than 10 ticks offset if you wish, it is up to you.

                To see the other plot, you have to assign the value to it like you are with SlingBuy but perhaps you want to put it on the otherside of the candle, the choices are yours to make.

                Comment


                  #9
                  Thank you, Paul
                  I will take a look and see if I can straighten it out.
                  Thanks again for your time and knowledge.

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                  0 responses
                  566 views
                  0 likes
                  Last Post Geovanny Suaza  
                  Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                  0 responses
                  329 views
                  1 like
                  Last Post Geovanny Suaza  
                  Started by Mindset, 02-09-2026, 11:44 AM
                  0 responses
                  101 views
                  0 likes
                  Last Post Mindset
                  by Mindset
                   
                  Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                  0 responses
                  547 views
                  1 like
                  Last Post Geovanny Suaza  
                  Started by RFrosty, 01-28-2026, 06:49 PM
                  0 responses
                  548 views
                  1 like
                  Last Post RFrosty
                  by RFrosty
                   
                  Working...
                  X