Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Need Real Simple Code Help for Indicator

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

    Need Real Simple Code Help for Indicator

    Hi, how would I need to set the plot code for this:

    (High/Low)-1)*100

    If anyone could post the exact plot line I need to put in for this it would be greatly appreciated,

    Thanks for any help,
    Reed

    #2
    What is wrong with this code?

    Plot0.Set(PriorDayOHLC().PriorHigh / PriorDayOHLC().PriorLow -1 * 100

    Seems like that is what should work, but it doesnt... what is wrong with this code, any help is much needed and apreciated...

    Comment


      #3
      tshirtdeal, you can only divide individual data series objects, not the full data series - try this for example -

      Code:
       
      double myValue = ((PriorDayOHLC().PriorHigh[0] / PriorDayOHLC().PriorLow[0]) - 1) * 100;
      
       
      Plot0.Set(myValue);
      BertrandNinjaTrader Customer Service

      Comment


        #4
        Thanks Bertrand- How Do I Add Other Plots?

        How do I then add 2 other plots kind of like for values of the indicator,

        such as the RSI or Stochastics where you can put lines across at certian values?

        Comment


          #5
          Hello,

          I suggest looking at one of those indicators and mimicing what they do to produce it. For Stoch. here are some key elements to look at:
          //in initialize
          Add(new Plot(Color.Orange, "K"));

          //in properties
          [Browsable(false)]
          [XmlIgnore()]
          public DataSeries K
          {
          get { return Values[1]; }
          }
          DenNinjaTrader Customer Service

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by rdtdale, Yesterday, 01:02 PM
          2 responses
          15 views
          0 likes
          Last Post rdtdale
          by rdtdale
           
          Started by TradeSaber, Today, 07:18 AM
          0 responses
          7 views
          0 likes
          Last Post TradeSaber  
          Started by PaulMohn, Today, 05:00 AM
          0 responses
          10 views
          0 likes
          Last Post PaulMohn  
          Started by ZenCortexAuCost, Today, 04:24 AM
          0 responses
          6 views
          0 likes
          Last Post ZenCortexAuCost  
          Started by ZenCortexAuCost, Today, 04:22 AM
          0 responses
          3 views
          0 likes
          Last Post ZenCortexAuCost  
          Working...
          X