Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

creating two bands envolving the price

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

    creating two bands envolving the price

    Hi, I'm trying to program an indicator that plots on the chart, two bands and i'm having some problems, do you see whats going wrong in this code?

    protectedoverridevoid OnBarUpdate()
    {
    double Value0 = (Low[0]*(1-2*((((High[0]-Low[0])/((High[0]+Low[0])/2))*1000)*1/1000)));
    double Value1 = (Low[0]*(1+2*((((High[0]-Low[0])/((High[0]+Low[0])/2))*1000)*1/1000)));
    double Lowerband = SMA(Value0,20)[0];
    double Higherband = SMA(Value1,20)[0];
    Bandainferior.Set(Lowerband);
    Bandasuperior.Set(Higherband);
    }

    when I try to compile it returns this code errors: CS 1502, NT1503.

    Thanks.

    #2
    Hi julen,

    One of our techs training in NinjaScript will respond later in the day. Thank you for your patience.
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      Hello,

      Within the SMA() method your Value0 and Value1 need to be dataseries. Here is a link that will help you with SMA():
      http://www.ninjatrader-support.com/H...verageSMA.html

      Here is a link on how to create a DataSeries:
      http://www.ninjatrader-support.com/H...iesObject.html

      As a note, you can find your error code here:
      http://www.ninjatrader-support.com/H...V6/CS1502.html
      DenNinjaTrader Customer Service

      Comment


        #4
        hi

        EMAEnvelope same as MAEnvelope but whith EMA
        hope it helps
        Attached Files

        Comment


          #5
          high-low price bands

          How would I set up a set of bands that give over the period X ,the moving average of a price high and a price low.

          say a 4 ma of one minute bar highs,and a 4 ma of one minute lows,set up over price chart as lines?

          Comment


            #6
            You could simply add two EMA's to your chart, one with the 'Price type' input set to 'High', the other with the input set to 'Low'. This should create the channel you need.
            BertrandNinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by wooofad, Today, 05:38 PM
            0 responses
            4 views
            0 likes
            Last Post wooofad
            by wooofad
             
            Started by caacapital, Today, 10:10 AM
            1 response
            15 views
            0 likes
            Last Post NinjaTrader_ShawnB  
            Started by DiverG20, Today, 10:23 AM
            0 responses
            22 views
            0 likes
            Last Post DiverG20  
            Started by SuneSorgenfrei, Today, 09:29 AM
            0 responses
            22 views
            0 likes
            Last Post SuneSorgenfrei  
            Started by dodoei, Today, 07:24 AM
            0 responses
            14 views
            0 likes
            Last Post dodoei
            by dodoei
             
            Working...
            X