or here http://www.ninjatrader.com/support/f...ink&linkid=399
NinjaTrader Ultimate Expression Indicator
=========================================
There're couple of indicators that allow to plot spreads. However,
all of them have severe limitations as to number of legs and mathematical
complexity of expressions one can input. As none of them really
suit my needs I decided to develop a new indicator from scratch that would
overcome these shortcomings. The indicator I've developed allows to include
any number of legs, input any meaningful math. expression and also implements
variety of math. functions.
Examples:
---------
(1 + LOG10(1) + SQRT(0.5 + 3.5) + 3)/(1+RANDOM(1,5))
(3*'MSFT'+1.5*'ORCL'+2*'HPQ'+'IBM')/(5*"QQQQ")
('AAPL:Open'+'AMZN:High'+'MSFT:Low'+'IBM:Close')/(12*'QQQQ')
"ES 09-10:BidAskMid$"-'YM 09-10:BidAskMid$'
'$EURCAD:High'/'$EURAUD:Low'
(("NQ 09-10:H"-"NQ 09-10:L")/2.0)/"NQ 09-10:Volume"
('ES 09-10:$2'+'ES 09-10:$1')/(2*'ES 09-10:$0')
'ES 09-10:$Open@1Week'-'ES 09-10:$Close@1Day'
Math:
-----
- always use dot(.) to denote decimal places regardless of your
operating system settings or localization (e.g.: 1.23, -0.6, +3.33)
+ - addition
- - subtraction
/ - division
* - multiplication
% - modulus
^ - power
( - left bracket
) - right bracket
Instruments:
------------
- all instrument types are supported (stocks 'MSFT', futures 'ES 09-10',
currencies '$EURUSD', indexes '^VIX')
- instruments don't need to be explicitly added to the chart to be able to
use them in expressions
- instruments must always be enclosed in single or double quotation marks
- instruments, instrument qualifiers and instrument time frames are case
insensitive
- instrument qualifiers are optional, if omitted bar close value is used
- instrument time frames are optional, if omitted time frame of primary
(first) instrument in the chart is used
- 'InstrumentName:Qualifier@TimeFrame'
- "InstrumentName@TimeFrame:Qualifier"
- 'InstrumentName:Qualifier'
- "InstrumentName@TimeFrame"
- 'InstrumentName'
Instrument qualifiers:
----------------------
- use 'colon' ( to indicate beginning of instrument qualifier sequence
- use 'dollar sign' ($) to multiply instrument value by instrument point
value that is taken from the Instrument Manager, this qualifier can be
combined with others
- use any integer number greater than or equal to zero to denote how
many bars to look back (bars ago) from bar that is being processed,
'zero' is default value and referes to current bar, this qualifier
can be combined with others
- following qualifiers are self explanatory and cannot be combined
with each other:
- O or Open
- H or High
- L or Low
- C or Close - this is default value
- V or Volume
- B or Bid
- A or Ask
- BAM or BidAskMid
Instrument time frames:
-----------------------
- use 'at' (@) to indicate beginning of instrument time frame sequence
- time frame comprises two mandatory components: period value
and period type
- period value is any integer number greater than zero
- period type is any of the following values:
- S or Second
- M or Minute
- D or Day
- W or Week
- Y or Year
- T or Tick
- V or Volume
- R or Range
Functions:
----------
- functions are case insensitive
- unless specified otherwise functions take one argument
random - returns random number within the specified range, requires two arguments
power - returns number raised to the specified power, requires two arguments
abs - returns absolute value of the specified number
sqrt - returns square root of the specified number
ceiling - returns the smallest integer greater than or equal to the specified decimal number
floor - returns the largest integer less than or equal to the specified decimal number
round - rounds decimal number to nearest integer
ln - returns natural logarithm of the specified number
log10 - returns base-10 logarithm of the specified number
sin - returns sine of the specified number
cos - returns cosine of the specified number
tan - returns tangent of the specified number
arcsin - returns arcsine of the specified number
arccos - returns arccosine of the specified number
arctan - returns arctangent of the specified number
If you're missing some feature, have a suggestion or have found a bug,
just leave a message in NT discussion forum. I'll be more than happy
to implement it provided that other users would also benefit.
Enjoy and good luck with your trading endeavours.
-UltimateIndicator-
Installation
============
- open up NinjaTrader, go to File -> Utilities -> Import NinjaScript,
navigate to 'zip' installation fileand click open,
restart NinjaTrader if prompted to do so
- this indicator requires NinjaTrader 7.0.0.16 or higher
- installation 'zip' file contains files:
NinjaTrader.Ultimate.Expression.dll
screenshot.png
readme.txt
Version history
===============
Version 0.1.3.0 - 31/01/2011
----------------------------
- improved - minor internal improvements, new features to come soon (hopefully)
Version 0.1.2.0 - 01/11/2010
----------------------------
- added - front end to build and manage database of favorite expressions
Version 0.1.1.0 - 02/08/2010
----------------------------
- added - support for time frames
- improved - instrument qualifiers can be used to address previous bars
- improved - indicator property window stays opened when expression
has syntax errors
- fixed - the indicator didn't work when nested within other indicators
- fixed - the indicator was not updated when NT was using realtime data
Version 0.1.0.0 - 13/07/2010
----------------------------
- initial release
Comment