Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to reference PriceType

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

    #16
    Josh,
    To ask your help is like a game of cat and mouse.
    Look how a lot of energy is going on nothing.
    My code demonstrates a use of SMA(High, 10) which brings back SMA(Close,10). That and the fact that on the chart in back testing, because Add(SMA(High,period)) is not supported, it shows SMA(Close,10) those are the NT BUGS!!
    If this doesn't work, then of course more sophisticated implementation of price type won't work.

    Baruch
    p.s.
    Please look from the beginning of this thread, what answers I received.

    Comment


      #17
      There is no bug blaruch. Take a look at this reference. Very distinct high and low SMA's. This is why you need to submit an as-simple-as-possible reference that is able to demonstrate the issues you are having so we can evaluate it.

      All you did in your strategy was:
      Code:
      Add(SMA(Fast));
      Add(SMA(Slow));
      For sure these two added SMA's will be of close pirces only.
      Attached Files
      Josh P.NinjaTrader Customer Service

      Comment


        #18
        Josh,
        Please just tell me how do I add SMA(High,10)???? Is it Add(SMA(High,10))???
        What I did was trying to calculate it from hights, but this didn't work.
        I attach the first more complicated strategy, please show me how to correct it.

        Baruch
        Attached Files

        Comment


          #19
          Baruch,

          Please just look at the code I attached in my previous post.

          It is indeed just Add(SMA(High, 10));
          Josh P.NinjaTrader Customer Service

          Comment


            #20
            Josh,
            My mistake. I just looked. Still how can I reference price type indirect.
            Please look at my attachment.

            Baruch
            Attached Files

            Comment


              #21
              Baruch,

              You should not be creating DataSeries objects for this. Your switch just needs to be inside the Initialize() method.

              See attached.
              Attached Files
              Josh P.NinjaTrader Customer Service

              Comment


                #22
                Thanks Josh.
                Now I understand that it can work. The question is can it be done without a switch. My actual strategy has 16 different MA's for fast and for slow. I already have two switches for picking MA's. What you propose will force me to do switch for each MA. The switch that I have in demo strat is for calculating the bararray.

                Baruch

                Comment


                  #23
                  Baruch,

                  You will have to do so.
                  Josh P.NinjaTrader Customer Service

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                  0 responses
                  639 views
                  0 likes
                  Last Post Geovanny Suaza  
                  Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                  0 responses
                  366 views
                  1 like
                  Last Post Geovanny Suaza  
                  Started by Mindset, 02-09-2026, 11:44 AM
                  0 responses
                  107 views
                  0 likes
                  Last Post Mindset
                  by Mindset
                   
                  Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                  0 responses
                  569 views
                  1 like
                  Last Post Geovanny Suaza  
                  Started by RFrosty, 01-28-2026, 06:49 PM
                  0 responses
                  572 views
                  1 like
                  Last Post RFrosty
                  by RFrosty
                   
                  Working...
                  X