• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

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 uiwislth, Yesterday, 11:25 PM
                  0 responses
                  3 views
                  0 likes
                  Last Post uiwislth  
                  Started by Steve L, Yesterday, 10:04 PM
                  0 responses
                  2 views
                  0 likes
                  Last Post Steve L
                  by Steve L
                   
                  Started by marianfed, Yesterday, 09:47 PM
                  0 responses
                  3 views
                  0 likes
                  Last Post marianfed  
                  Started by hir04068, Yesterday, 09:29 PM
                  0 responses
                  2 views
                  0 likes
                  Last Post hir04068  
                  Started by iq200, 03-11-2018, 07:49 PM
                  24 responses
                  1,011 views
                  0 likes
                  Last Post mrlucky1x  
                  Working...
                  X