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

Demand Index

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

    Demand Index

    Has anyone coded the Demand Index designed by James Sibbet?

    #2
    billm, unfortunately I'm not aware of one already posted, have you checked into the sharing section already?

    BertrandNinjaTrader Customer Service

    Comment


      #3
      Hello Bertrand, yes, I searched and found nothing posted. As it is a less popularized calculation from the days of computrac maybe its value has been overlooked?

      Comment


        #4
        Might be, I don't think it's that popular - if you have the formula and want to give it a shot, here are the indicator coding tutorials - http://www.ninjatrader-support.com/H...verview18.html
        BertrandNinjaTrader Customer Service

        Comment


          #5
          I have used the Demand Index for years and find it helpful at divergent bottoms (i.e. BA on 06/07/2010). I am converting from TradeStation, have the TS2ki code and would be thankful if someone can code it in NT

          Comment


            #6
            Coded Demand index for NT 7.0

            Originally posted by billm View Post
            Has anyone coded the Demand Index designed by James Sibbet?

            This is the Coded from another platform, can some one coded it for NT7.0

            #

            declare lower;

            input length = 5;

            def wClose = (high + low + 2 * close) * 0.25;
            def wCRatio = (wClose - wClose[1]) / Min(wClose, wClose[1]);
            def closeRatio = 3 * wClose / Average(Highest(High, 2) - Lowest(Low, 2), length) * AbsValue(wCRatio);
            def volumeRatio = Volume / Average(Volume, length);
            def volumePerClose = volumeRatio / exp(Min(88, closeRatio));
            def buyP;
            def sellP;
            if (wCRatio > 0) {
            buyP = volumeRatio;
            sellP = volumePerClose;
            } else {
            buyP = volumePerClose;
            sellP = volumeRatio;
            }
            def buyPres = if IsNaN(buyPres[1]) then 0 else ((buyPres[1] * (length - 1)) + buyP) / length;
            def sellPres = if IsNaN(sellPres[1]) then 0 else ((sellPres[1] * (length - 1)) + sellP) / length;
            def tempDI;
            if ((((sellPres[1] * (length - 1)) + sellP) / length - ((buyPres[1] * (length - 1)) + buyP) / length) > 0) {
            tempDI = - if (sellPres != 0) then buyPres / sellPres else 1;
            } else {
            tempDI = if (buyPres != 0) then sellPres / buyPres else 1;
            }
            plot DMIndx = if IsNaN(close) then Double.NaN else if tempDI < 0 then -1 - tempDI else 1 - tempDI;
            plot ZeroLine = 0;

            DMIndx.setDefaultColor(GetColor(1));
            ZeroLine.SetDefaultColor(GetColor(5));

            Comment


              #7
              Originally posted by [email protected] View Post
              This is the Coded from another platform, can some one coded it for NT7.0

              #

              declare lower;

              input length = 5;

              def wClose = (high + low + 2 * close) * 0.25;
              def wCRatio = (wClose - wClose[1]) / Min(wClose, wClose[1]);
              def closeRatio = 3 * wClose / Average(Highest(High, 2) - Lowest(Low, 2), length) * AbsValue(wCRatio);
              def volumeRatio = Volume / Average(Volume, length);
              def volumePerClose = volumeRatio / exp(Min(88, closeRatio));
              def buyP;
              def sellP;
              if (wCRatio > 0) {
              buyP = volumeRatio;
              sellP = volumePerClose;
              } else {
              buyP = volumePerClose;
              sellP = volumeRatio;
              }
              def buyPres = if IsNaN(buyPres[1]) then 0 else ((buyPres[1] * (length - 1)) + buyP) / length;
              def sellPres = if IsNaN(sellPres[1]) then 0 else ((sellPres[1] * (length - 1)) + sellP) / length;
              def tempDI;
              if ((((sellPres[1] * (length - 1)) + sellP) / length - ((buyPres[1] * (length - 1)) + buyP) / length) > 0) {
              tempDI = - if (sellPres != 0) then buyPres / sellPres else 1;
              } else {
              tempDI = if (buyPres != 0) then sellPres / buyPres else 1;
              }
              plot DMIndx = if IsNaN(close) then Double.NaN else if tempDI < 0 then -1 - tempDI else 1 - tempDI;
              plot ZeroLine = 0;

              DMIndx.setDefaultColor(GetColor(1));
              ZeroLine.SetDefaultColor(GetColor(5));
              I always look out for interesting volume indicator, try this.
              Edit: just realize this is almost 10 year old thread.
              Attached Files
              Last edited by nkhoi; 04-28-2018, 12:23 AM.

              Comment


                #8
                This indicator has been converted to NT8 and can be found at the following link:
                https://ninjatrader.com/support/foru...=7&linkid=1091
                Josh G.NinjaTrader Customer Service

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by TraderBCL, Today, 04:38 AM
                1 response
                6 views
                0 likes
                Last Post bltdavid  
                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
                606 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