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

Stoch Momentum Indicator

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

    Stoch Momentum Indicator

    Hello all,

    Is there anybody on this board able to translate the SMI :

    Stochastic Momentum Indicator by William Blau. The result is an oscillator that ranges between +/- 100 and is a bit less erratic than an equal period Stochastic Oscillator. While similar to the Stochastic Oscillator, the SMI displays where the close is relative to the midpoint of the recent high/low range, as compared to the close relative to the recent high/low with the Stochastic Oscillator. This results is an oscillator that ranges between -100 and +100 and can be a bit less erratic than an equal period Stochastic Oscillator.


    An example formula (see Stochastic Momentum Index) illustrates the calculation of the Stochastic Momentum Index. When the close is greater than the midpoint of the range, the SMI is positive. When the close is less than the midpoint of the range, it is negative. The interpretation of the SMI is virtually identical to the Stochastic Oscillator.

    Stochastic Momentum Indicator

    100 * ( Mov( Mov(C - (.5 * ( HHV(H,13) + LLV(L,13))),25,E),2,E)/
    (.5*Mov(Mov( HHV(H,13) - LLV(L,13),25,E),2,E)))

    Many thanks for your attention,

    Happy trading

    Cheers

    Angel

    #2
    Stochastic Momentum Indicator

    Hello,

    This is below the Easy Language code for the SMI, it would be so kind if someone could translate it in NT code. Sincerely, adding the SMI in our trading arsenal would be an edge !!!

    Thanks for your careful attention,

    Happy trading,

    Cheers

    Angel

    .................................................. .................................................. ....

    Type : Function, Name : SMI

    input:
    length1(NumericSimple),
    length2(NumericSimple),
    length3(NumericSimple);

    var:
    HH(0),
    LL(0);

    HH = Highest(H,length1);
    LL = Lowest (L,length1);

    SMI = 100 * (XAverage(XAverage(C-(0.5*(HH+LL)),length2),length3) /
    (0.5 * XAverage(XAverage(HH-LL,length2),length3)));

    .................................................. .................................................. ...

    Type : Indicator, Name : SMI

    input:length1(13),length2(25),length3(2),alertLeve l(40);

    plot1( smi(length1,length2,length3), "SMI" );
    plot2( alertLevel, "sell line" );
    plot3(-alertLevel, "buy line" );

    if plot1 crosses above -alertLevel then
    alert("SMI crosses above buy line");

    if plot1 crosses below alertLevel then
    alert("SMI crosses below sell line");

    Comment


      #3
      Stochastic Momentum Index for Ninja

      So, i put this together but am not sure if it is correct, as i have nothing to compare against. Some comments please? Or if someone would like to make some code adjustments, please do.

      cheers
      Mat
      Attached Files

      Comment


        #4
        Stochastic Momentum Index for Ninja

        Doesn't look like this indicator works. It didn't show any data for me.

        Thanks,

        Mahlon

        Comment


          #5
          Hi Mahlon,

          I tested the indicator on my end and it plotted data as you can see in the screenshot.

          I suggest to delete the indicator via Tools-->Edit NinjaScript-->Indicator.

          Re-import the indicator and check if it will plot data. If not, please check the Log-tab for any error messages.
          Attached Files
          JasonNinjaTrader Customer Service

          Comment


            #6
            Jason,

            Thanks for your help. I followed your suggestion and it worked great.

            Mahlon

            Comment


              #7
              Hi Jason,

              this indicator looks great, but one problem is : it works on some instruments (eg FDAX), but not with others (eg ES)

              any hints what's the matter ?

              thanks in advance

              bluejay

              Comment


                #8
                Hi bluejay,

                This is not an indicator we made. You want to contact the original author, mwyatt.
                Josh P.NinjaTrader Customer Service

                Comment


                  #9
                  the smi indicator doesnt draw anything in my chart. (just empty)

                  any suggestion/help?

                  in the log it says "DefaultError on plotting indicator 'StochasticMomentumIndex'. Please check the 'OnBarUpdate' or the 'Plot' method: Overflow error."

                  Comment


                    #10
                    You would have to debug or ask the original author to do so.
                    RayNinjaTrader Customer Service

                    Comment


                      #11
                      Here is another version of Stochastic Momentum Index which doesn't get an Overflow error. I tested it against Thinkorswim built-in SMI indicator.
                      Attached Files

                      Comment


                        #12
                        Hey Everyone,

                        Does anyone know how to set this to a 20/80 setting instead of -40/40?

                        Comment


                          #13


                          You can also edit the script and in the initialize section change the line values.

                          Comment


                            #14
                            Hey EW,

                            The lines still plot normally. Is there a way to change this?

                            Comment


                              #15
                              Its working fine for me here, unless I'm misunderstanding your problem.

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by thanajo, 05-04-2021, 02:11 AM
                              3 responses
                              468 views
                              0 likes
                              Last Post tradingnasdaqprueba  
                              Started by Christopher_R, Today, 12:29 AM
                              0 responses
                              10 views
                              0 likes
                              Last Post Christopher_R  
                              Started by sidlercom80, 10-28-2023, 08:49 AM
                              166 responses
                              2,237 views
                              0 likes
                              Last Post sidlercom80  
                              Started by thread, Yesterday, 11:58 PM
                              0 responses
                              4 views
                              0 likes
                              Last Post thread
                              by thread
                               
                              Started by jclose, Yesterday, 09:37 PM
                              0 responses
                              9 views
                              0 likes
                              Last Post jclose
                              by jclose
                               
                              Working...
                              X