NinjaTrader Support Forum  

Go Back   NinjaTrader Support Forum > NinjaScript Development Support > Indicator Development

Indicator Development Support for the development of custom indicators using NinjaScript.

Reply
 
Thread Tools Display Modes
Old 12-12-2007, 12:11 PM   #1
Angel
Member
 
Join Date: May 2007
Location: , ,
Posts: 50
Thanks: 0
Thanked 0 times in 0 posts
Default 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
Angel is offline  
Reply With Quote
Old 12-13-2007, 05:09 AM   #2
Angel
Member
 
Join Date: May 2007
Location: , ,
Posts: 50
Thanks: 0
Thanked 0 times in 0 posts
Default 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");
Angel is offline  
Reply With Quote
Old 12-16-2007, 11:27 PM   #3
mwyatt
Junior Member
 
Join Date: Sep 2007
Posts: 12
Thanks: 0
Thanked 1 time in 1 post
Default 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
File Type: zip StochasticMomentumIndex.zip (6.8 KB, 240 views)
mwyatt is offline  
Reply With Quote
Old 10-20-2008, 09:26 PM   #4
mahlonhersh
Member
 
Join Date: Jul 2008
Posts: 34
Thanks: 0
Thanked 0 times in 0 posts
Default Stochastic Momentum Index for Ninja

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

Thanks,

Mahlon
mahlonhersh is offline  
Reply With Quote
Old 10-21-2008, 03:35 AM   #5
NinjaTrader_Jason
NinjaTrader Customer Service
 
NinjaTrader_Jason's Avatar
 
Join Date: Aug 2007
Location: Breda, Netherlands
Posts: 11,215
Thanks: 82
Thanked 332 times in 324 posts
Default

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 Images
File Type: jpg SMI.JPG (50.5 KB, 336 views)
NinjaTrader_Jason is offline  
Reply With Quote
Old 10-21-2008, 08:22 AM   #6
mahlonhersh
Member
 
Join Date: Jul 2008
Posts: 34
Thanks: 0
Thanked 0 times in 0 posts
Default

Jason,

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

Mahlon
mahlonhersh is offline  
Reply With Quote
Old 11-12-2008, 01:40 PM   #7
bluejay
Junior Member
 
Join Date: Nov 2008
Posts: 10
Thanks: 0
Thanked 0 times in 0 posts
Default

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
bluejay is offline  
Reply With Quote
Old 11-12-2008, 01:55 PM   #8
NinjaTrader_Josh
NinjaTrader Product Manager
 
NinjaTrader_Josh's Avatar
 
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 106 times in 70 posts
Default

Hi bluejay,

This is not an indicator we made. You want to contact the original author, mwyatt.
NinjaTrader_Josh is offline  
Reply With Quote
Old 12-07-2008, 09:23 AM   #9
mni4tw
Junior Member
 
Join Date: Dec 2008
Posts: 5
Thanks: 0
Thanked 0 times in 0 posts
Default

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."

mni4tw is offline  
Reply With Quote
Old 12-07-2008, 02:00 PM   #10
NinjaTrader_Ray
Administrator
 
NinjaTrader_Ray's Avatar
 
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,163
Thanks: 6
Thanked 45 times in 32 posts
Default

You would have to debug or ask the original author to do so.
NinjaTrader_Ray is offline  
Reply With Quote
Old 12-09-2008, 04:05 PM   #11
GorSvet
Junior Member
 
Join Date: Dec 2008
Location: Rolling Meadows, IL
Posts: 4
Thanks: 0
Thanked 0 times in 0 posts
Default

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
File Type: cs StochasticMomentumIndex.cs (8.3 KB, 168 views)
GorSvet is offline  
Reply With Quote
Old 12-09-2008, 09:31 PM   #12
Drakmyre
Senior Member
 
Join Date: Jan 2008
Posts: 103
Thanks: 0
Thanked 0 times in 0 posts
Default

Hey Everyone,

Does anyone know how to set this to a 20/80 setting instead of -40/40?
Drakmyre is offline  
Reply With Quote
Old 12-09-2008, 09:54 PM   #13
Elliott Wave
Senior Member
 
Join Date: Mar 2008
Posts: 731
Thanks: 0
Thanked 1 time in 1 post
Default



You can also edit the script and in the initialize section change the line values.
Elliott Wave is offline  
Reply With Quote
Old 12-09-2008, 10:05 PM   #14
Drakmyre
Senior Member
 
Join Date: Jan 2008
Posts: 103
Thanks: 0
Thanked 0 times in 0 posts
Default

Hey EW,

The lines still plot normally. Is there a way to change this?
Drakmyre is offline  
Reply With Quote
Old 12-09-2008, 10:46 PM   #15
Elliott Wave
Senior Member
 
Join Date: Mar 2008
Posts: 731
Thanks: 0
Thanked 1 time in 1 post
Default

Its working fine for me here, unless I'm misunderstanding your problem.
Elliott Wave is offline  
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Stochastic Momentum Index geoarb Indicator Development 21 03-14-2012 02:32 AM
Howard Indicator and Pesavento Pattern Swing Indicator DORAIRAJ_S@HOTMAIL.COM Indicator Development 1 11-12-2007 12:28 AM
Using Strategy Wizard to develope Indicator on Indicator mrlucky1x Indicator Development 3 08-25-2007 04:09 PM
Momentum Indicator Quicktrader10 NinjaScript File Sharing Discussion 1 08-20-2007 02:11 AM
Momentum bars or Price Range Bars Akros Indicator Development 7 06-10-2007 04:55 AM


All times are GMT -6. The time now is 11:29 PM.