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

DiPlus & DiMinus

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

    DiPlus & DiMinus

    My simple indicator works on CrossAbove or Below like this :
    private int oper = 8;
    CrossAbove(DM(oper).DiPlus, DM(oper).DiMinus, 1)
    and ADX(oper)[0]>23

    but when i print in Output all values I have different values then DM indicator on my workspace.

    I print this :
    Print(Time[0].ToString());
    Print("The current D+ value is " + DM(oper).DiPlus[0]);
    Print("The current D- value is " + DM(oper).DiMinus[0]);
    Print("The current ADX value is " + ADX(oper)[0]);

    The ADX is correct but DiPlus and DiMinus are different ... and so some signal are not true.

    Why this ?

    Thanks in advance.

    #2
    Hello sniper,

    Thank you for your post.

    Are you seeing difference in the decimal place? Such as 100.25 on your chart but seeing 100.245678 in the Output?

    Comment


      #3
      No, sorry.
      For example : in the output I have these :
      11/12/2014 17:32:00
      The current D+ value is 20,6051981657602
      The current D- value is 13,6712931036324
      The current ADX value is 26,7155370430123

      But on my DM workspace i have :
      ADX = 34,14
      +DI = 19,79
      -DI = 14,34

      Comment


        #4
        Something is wrong.
        After several tests I confirm that the output values are different from those I read on my DM indicator, NT default indicator.
        The period are the same but the values are different.
        Can you also check you ?
        I await your kind reply .

        Comment


          #5
          Hello sniper,

          Print the values with ToString("N");. For example: Print("The current ADX value is " + ADX(oper)[0].ToString("N"));

          Comment


            #6
            Nothing ... on Output I have :
            The current D+ value is 23,89
            The current D- value is 18,56
            The current ADX value is 29,21

            And my workspace i have :

            ADX : 33,19
            +DI : 20,99
            -DI : 19,17

            Comment


              #7
              Sniper,

              I tried the same thing on my end and I'm seeing the same values between the chart and the indicator prints.

              Are you working with a Multi-Timeframe/Instrument Script?

              What are the settings for CalculateOnBarClose for both the DM indicator and the script you are using?
              Cal H.NinjaTrader Customer Service

              Comment


                #8
                No, this script ( attached below) no have mutitimeframe script.

                Please, can toy check the attached script for me ?

                Thanks
                Attached Files

                Comment


                  #9
                  sniper,

                  I have attached a picture with your indicator prints and the DM on the chart.

                  As you can see the values are matching up.

                  Ensure that you have both indicators using the same Period Setting.
                  Attached Files
                  Cal H.NinjaTrader Customer Service

                  Comment


                    #10
                    Solved !

                    I simply removed and replaced the indicator, and now it works fine.

                    I was going crazy.

                    Thank a lot for your patience.

                    Comment

                    Latest Posts

                    Collapse

                    Topics Statistics Last Post
                    Started by algospoke, Yesterday, 06:40 PM
                    2 responses
                    19 views
                    0 likes
                    Last Post algospoke  
                    Started by ghoul, Today, 06:02 PM
                    3 responses
                    14 views
                    0 likes
                    Last Post NinjaTrader_Manfred  
                    Started by jeronymite, 04-12-2024, 04:26 PM
                    3 responses
                    45 views
                    0 likes
                    Last Post jeronymite  
                    Started by Barry Milan, Yesterday, 10:35 PM
                    7 responses
                    20 views
                    0 likes
                    Last Post NinjaTrader_Manfred  
                    Started by AttiM, 02-14-2024, 05:20 PM
                    10 responses
                    181 views
                    0 likes
                    Last Post jeronymite  
                    Working...
                    X