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

Indicator plotting expressions / spreads / pairs / baskets

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

    Indicator plotting expressions / spreads / pairs / baskets

    NinjaTrader Ultimate Expression Indicator
    =========================================
    There're couple of indicators that allow to plot spreads. However,
    all of them have significant 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.

    You can plot up to four different expressions using only one instance
    of the indicator. Obviously, you can add as many instances of the indicator on
    a chart as you want. The first expression can be plotted using five different
    plot types: candlestick, OHLC, HiLo, box and line. The remaining three
    expressions can be plotted only as lines.


    Examples:
    ---------
    (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:$Open@1Week'-'ES 09-10:$Close@1Day'
    EMA('GLD',20)-EMA('GLD',10)
    SMA('SLV',20)[2]-SMA('GLD',10)[1]
    ('ES 09-10:$'[2]+'ES 09-10:$'[1])/('ES 09-10:$'[0]*2)
    BondYield(20110630,20171231,0.0275,0.8272*'ZN 06-11',100,2,1)*100
    (1 + LOG10(1) + SQRT(0.5 + 3.5) + 3)/(1+RANDOM(1,5))

    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 apostrophes or 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
    - 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
    - M or Median - calculate as follows: (High + Low) / 2
    - T or Typical - calculate as follows: (High + Low + Close) / 3
    - W or Weighted - calculate as follows: (High + Low + Close + Close) / 4
    - 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


    Bars ago:
    ---------
    - allows to look back in specified data series (instruments or
    NinjaTrader functions) and obtain preceding (historical) value
    from bar that is processed
    - use any integer number greater than or equal to zero to denote
    how many bars to look back, 'zero' is default value which referes
    to current bar and is usually omitted
    - must be enclosed in square brackets and specified behind
    instrument names or behind NinjaTrade functions (e.g. 'MSFT'[1],
    EMA('AAPL:High', 20)[2], 'GLD'[0] is equivalent to 'GLD')


    Functions:
    ----------
    - functions are case insensitive
    - unless specified otherwise functions take one argument
    - always input dates in the following format: yyyyMMdd (e.g. 31st of December 2010 input as 20101231)
    - there are two types of functions available:

    1) The indicator built-in functions:
    ------------------------------------
    BondYield - returns the yield on a security that pays periodic interest, requires seven arguments,
    this function is useful for calculating implied yields of various interest rate instruments,

    as this function duplicates Microsoft Excel function YIELD, please refer to Microsoft Excel help for more details
    Microsoft support is here to help you with Microsoft products. Find how-to articles, videos, and training for Microsoft Copilot, Microsoft 365, Windows, Surface, and more.

    BondPrice - returns the price per $100 face value of a security that pays periodic interest, requires seven arguments,
    as this function duplicates Microsoft Excel function PRICE, please refer to Microsoft Excel help for more details
    Microsoft support is here to help you with Microsoft products. Find how-to articles, videos, and training for Microsoft Copilot, Microsoft 365, Windows, Surface, and more.

    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
    Seiling - 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

    2) NinjaTrader functions:
    -------------------------
    - by NinjaTrader functions are meant all default and custom indicators
    - to see a complete list of available NinjaTrader functions
    and their arguments, please bring up the indicator properties
    window and click on the Functions link
    - please note, some NinjaTrader functions may not work properly
    when used within the indicator, however most common functions
    (e.g. SMA, EMA, RSI) should work without any problems
    - all NinjaTrader functions require at least one argument
    that is instrument name


    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.


    -UltimateIndicator-


    Installation
    ============
    - open up NinjaTrader, go to File -> Utilities -> Import NinjaScript,
    navigate to 'zip' installation file and click open,
    restart NinjaTrader if prompted to do so
    - this indicator requires NinjaTrader 7.0.0.16 or higher


    Version history
    ===============
    - detailed version history can be found in file 'readme.txt'
    which is included in the 'zip' installation file


    Note
    ====
    Originally, I created this thread in NT Version 7 Beta forum here: http://www.ninjatrader.com/support/f...ad.php?t=31382. As NT Version 7 is live now and the Beta forum has been locked I'm reposting it here.


    Download
    https://rapidshare.com/files/1680910...ion.v0.1.6.zip
    Attached Files
    Last edited by UltimateIndicator; 05-12-2011, 09:49 AM.

    #2
    How do you upgrade from ver 1.2 to 1.3?

    Comment


      #3
      Download link is at the very bottom of my initial post.

      Comment


        #4
        I should have been more specific.....after downloading the file.....do I remove version 1.2 and import 1.3 or just import 1.3?

        Comment


          #5
          ... either way.

          Comment


            #6
            Thanks for this great indicator!

            Do you plan to add also other NT standard math feature references such as MAs under the Parameters section ?
            Last edited by paulg; 02-03-2011, 06:29 AM.

            Comment


              #7
              How do I get rid of this indicator? I have the DLL sitting in my Bin-Custom folder but if I remove it, I cannot compile any strategies/indicators. I do not see any UltimeExpression indicators in my list of indicators.

              Any clue how to get rid of this?

              Comment


                #8
                You should be able to remove assemblies with File > Utilities > Remove NinjaScript assemblies.

                If it doesn't show up under this list:
                Manually delete the file.
                Remove reference in the NinjaScript editor. Right Click > References
                Ryan M.NinjaTrader Customer Service

                Comment


                  #9
                  The trick was to remove it from "references". Thanks

                  Comment


                    #10
                    Your download link no longer works!

                    Comment


                      #11
                      Renko charts

                      I tried using the ultimate expression indicator with renko charts and got this error message from the log:

                      3/1/2011 9:35:45 PM Default Failed to call method 'Initialize' for indicator '_UltimateExpression': Please use the alternate method 'AddRenko()' instead of Add()

                      Please advise.
                      Thanks

                      Comment


                        #12
                        Renko chart is not supported and I'm not looking to implement it.

                        Comment


                          #13
                          NT 7.0.1000.4 compatibility

                          NT 7.0.1000.4 asks to remove Ninjascript assemblies in order to upgrade from NT 7.0.1000.2 or earlier. After the upgrade, is this v0.1.3 release compatible with the new NT 7 release after reinstallation?

                          Comment


                            #14
                            Yes, version 0.1.3 is compatible with the latest version of NT. However, I've just uploaded newer version 0.1.4 which has got loads of new features and I strongly recommend upgrading to it.

                            Comment


                              #15
                              Would you expand on the new changes?

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by TraderBCL, Today, 04:38 AM
                              2 responses
                              14 views
                              0 likes
                              Last Post TraderBCL  
                              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
                              607 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