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

Negative offset

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

    Negative offset

    As discussed in strategy class on weekend, I want to write a negative offset (like a lower Bollinger band but exponential moving average). I wrote this successfully for the upper average as Close[0]==[EMA(10][0]*[1+.75] but for the lower it must be same but the +.75 becomes -.75. I can’t get this to work in the NT strategy editor as it always starts with a positive value. I would appreciate any ideas on the best way to do this.

    #2
    Have you tried entering into the "Offset" parameter

    -0.75

    ?
    RayNinjaTrader Customer Service

    Comment


      #3
      If you're going to use this in a strategy, I'd recommend encapsulating that logic in an indicator so you can easily put it on a chart.

      I don't quite understand the logic you are going for. What is the .75 supposed to be exactly?

      Comment


        #4
        Yes, but it comes out +-.75, and does not plot.

        Comment


          #5
          Right, that is correct.

          - What are you expecting to plot? If you are using a BollingerBand and you have "Plot on chart" enabled, it will plot the BollingerBand indicator itself.
          RayNinjaTrader Customer Service

          Comment


            #6
            In Metastock code I can plot this as "
            C>(Mov(C,10,E)+(.75*(Std(C,8))" The reason I do not use the NT Bollinger is that it only plots as a simple MA and is not adjustable to EMA or whatever. The longside of this plots well using the offest tool as in my orginal post. However, it always defaults to the long side, and does not anticipate a negative offest which is the equivalent of a band below the market.

            Comment


              #7
              So we are on the same page -

              When you say "plotting" you are referring to the EMA on the right side of the condition builder, correct?

              If yes, its plotting the EMA(10) *without* the offset. Offsets are not used to determine plotting but just used to create the condition.
              RayNinjaTrader Customer Service

              Comment


                #8
                It plotted on my chart correctly when I ticked the plot on chart box.

                Comment


                  #9
                  I can assure you that it will *only* plot the EMA(10) and not EMA(10) with an offset.
                  RayNinjaTrader Customer Service

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by TraderBCL, Today, 04:38 AM
                  2 responses
                  12 views
                  0 likes
                  Last Post TraderBCL  
                  Started by martin70, 03-24-2023, 04:58 AM
                  14 responses
                  105 views
                  0 likes
                  Last Post martin70  
                  Started by Radano, 06-10-2021, 01:40 AM
                  19 responses
                  607 views
                  0 likes
                  Last Post Radano
                  by Radano
                   
                  Started by KenneGaray, Today, 03:48 AM
                  0 responses
                  4 views
                  0 likes
                  Last Post KenneGaray  
                  Started by thanajo, 05-04-2021, 02:11 AM
                  4 responses
                  471 views
                  0 likes
                  Last Post tradingnasdaqprueba  
                  Working...
                  X