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

Convert from Easylanguage Please

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

    Convert from Easylanguage Please

    Easy-language to Ninjatrader code translation:

    Trying to understand what this PlotPercentP formula is doing so I can plot inside Ninjatrader, any help is appreciated. Thx in advance.

    Code:
    variables:
        intrabarpersist bool PlotPercentP( false ),
        double LowerBandP( 0 )                    , 
        double UpperBandP( 0 )                    ,
        double PercentP( 0 )                                     ;         
    once
        PlotPercentP = GetAppInfo( aiApplicationType ) <> cChart ;
    LowerBandP = Lowest( Low, Length )[1]                        ;
    UpperBandP = Highest( High, Length )[1]                      ;
    Last edited by tradethebonds; 04-08-2015, 09:27 AM.

    #2
    Hello,
    Thanks for posting today.

    We do not support other languages that not are NinjaScript. I am not familiar with Easylanguage but it appears that

    LowerBandP = Lowest( Low, Length )[1]

    is plotting the lowest of the low over a length (period) of time. However, I could be wrong on the logic behind this indicator. I am unsure how the PercentP is then calculated.

    If you are able to figure out what the plot is logically doing I could then help you apply the logic using NinjaScript principles.
    Alex G.NinjaTrader Customer Service

    Comment


      #3
      Originally posted by tradethebonds View Post
      Easy-language to Ninjatrader code translation:

      Trying to understand what this PlotPercentP formula is doing so I can plot inside Ninjatrader, any help is appreciated. Thx in advance.

      Code:
      variables:
          intrabarpersist bool PlotPercentP( false ),
          double LowerBandP( 0 )                    , 
          double UpperBandP( 0 )                    ,
          double PercentP( 0 )                                     ;         
      once
          PlotPercentP = GetAppInfo( aiApplicationType ) <> cChart ;
      LowerBandP = Lowest( Low, Length )[1]                        ;
      UpperBandP = Highest( High, Length )[1]                      ;
      You may want to look at the code for the DonchianChannel indicator that should be supplied in NinjaTrader. That might give you some ideas on how to do what you want.

      ~J

      Comment


        #4
        Please check my Ninja code?

        Could you please check my code to see if I am correct please?

        1) In order to have the linear regression value of the close over 21 bars?

        = LinReg(21)[0]

        2) How do I average the value from 1) with a smoothing length of 3?

        = EMA(LinRegValue,3)[0];

        3) How do I get the Standard Error Average of the close over 21 bars with a smoothing length of 3?

        = ((StdError(21).Upper[0] - StdError(3).Lower[0])) / 2;

        Comment


          #5
          Originally posted by tradethebonds View Post
          Could you please check my code to see if I am correct please?

          1) In order to have the linear regression value of the close over 21 bars?

          = LinReg(21)[0]

          2) How do I average the value from 1) with a smoothing length of 3?

          = EMA(LinRegValue,3)[0];

          3) How do I get the Standard Error Average of the close over 21 bars with a smoothing length of 3?

          = ((StdError(21).Upper[0] - StdError(3).Lower[0])) / 2;

          TradeTheBonds,

          You should just go to the Help file on LinReg, EMA and StdError. There are examples.

          J~

          Comment


            #6
            Yes I have tried the examples, from the help file, but they are not giving me the same values as the ones I am printing from my Tradestation code. So I must not have this correctly interpreted. But appreciate the help Jerry,

            I see the MAX & MIN in DochianChannel you had referred to, I appreciate that very much.
            Have a great big slice of the market today, will ya!

            Comment


              #7
              TradeTheBond

              Use a print statement in both the tradestation and Ninja code to print all the values , EMA , LinReg, StdError, etc. along with the symbol data you are passing it and the date and time so you can match them up to see what is going wrong.

              J~

              Comment


                #8
                Hello,

                As JerryWar said
                Use a print statement in both the tradestation and Ninja code to print all the values , EMA , LinReg, StdError, etc. along with the symbol data you are passing it and the date and time so you can match them up to see what is going wrong.
                Use the print statement to compare the outputs and see where the variance is within the NinjaTrader code vs the Trade Station.

                Here are some links to the help guide discussing the methods that JerryWar mentioned.

                Print() http://www.ninjatrader.com/support/h...html?print.htm
                Linear Regression http://www.ninjatrader.com/support/h...regression.htm
                EMA http://www.ninjatrader.com/support/h...onential_e.htm
                Standard Error http://www.ninjatrader.com/support/h...r_stderror.htm
                Alex G.NinjaTrader Customer Service

                Comment


                  #9
                  Are you sure your data is exactly the same?

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by adeelshahzad, Today, 03:54 AM
                  5 responses
                  32 views
                  0 likes
                  Last Post NinjaTrader_BrandonH  
                  Started by stafe, 04-15-2024, 08:34 PM
                  7 responses
                  32 views
                  0 likes
                  Last Post NinjaTrader_ChelseaB  
                  Started by merzo, 06-25-2023, 02:19 AM
                  10 responses
                  823 views
                  1 like
                  Last Post NinjaTrader_ChristopherJ  
                  Started by frankthearm, Today, 09:08 AM
                  5 responses
                  21 views
                  0 likes
                  Last Post NinjaTrader_Clayton  
                  Started by jeronymite, 04-12-2024, 04:26 PM
                  3 responses
                  43 views
                  0 likes
                  Last Post jeronymite  
                  Working...
                  X