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

Converting eld to nt

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

    Converting eld to nt

    Hi im looking for help from ppl who have experience in easy language.

    ive got the following code im attempting to convert to ninjascript:

    Value1 = 2 * WAverage(price, halvedLength);
    Value2 = WAverage(price, length);
    Value3 = WAverage((Value1 - Value2), sqrRootLength);

    The variable price is a NumericSeries. Value1 and Value2 are double.

    What i dont get is that you can do a WAverage from Value1-Value2? Im underthe impression that weighted averages take a defined period of a certain price type. Wha does taking a weighted average of Value1-Value2 mean?

    Having problems understanding this, would appreciate any help
    thanks
    ian

    #2
    Originally posted by iangohye View Post
    Hi im looking for help from ppl who have experience in easy language.

    ive got the following code im attempting to convert to ninjascript:

    Value1 = 2 * WAverage(price, halvedLength);
    Value2 = WAverage(price, length);
    Value3 = WAverage((Value1 - Value2), sqrRootLength);

    The variable price is a NumericSeries. Value1 and Value2 are double.

    What i dont get is that you can do a WAverage from Value1-Value2? Im underthe impression that weighted averages take a defined period of a certain price type. Wha does taking a weighted average of Value1-Value2 mean?

    Having problems understanding this, would appreciate any help
    thanks
    ian
    Hi ian,

    Thanks for your post.

    This just means it smoothes the difference (momentum) of Value1 - Value2 of the specified period input, in this case 'sqrRootLength'.

    The 'Input' does not have to be a Price type one (OHLC), but any type of a series of values, like other indicators for example, or volume.
    Last edited by NinjaTrader_Bertrand; 11-08-2008, 09:59 AM.
    BertrandNinjaTrader Customer Service

    Comment


      #3
      Thanks Bertrand for your reply

      Yup youve confirmed my understanding of averages. (ie. require a set of numbers over a certain period)

      But if the input requires a series of values, how does (Value1 - Value2) fit in there? since (Value1 - Value2) returns a single, double value.

      Comment


        #4
        You have to store Value1 - Value2 calculation for each bar in a DataSeries and then take the average of the DataSeries.

        More information - http://www.ninjatrader-support.com/H...iesObject.html
        RayNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Pattontje, Yesterday, 02:10 PM
        2 responses
        15 views
        0 likes
        Last Post Pattontje  
        Started by flybuzz, 04-21-2024, 04:07 PM
        17 responses
        229 views
        0 likes
        Last Post TradingLoss  
        Started by agclub, 04-21-2024, 08:57 PM
        3 responses
        17 views
        0 likes
        Last Post TradingLoss  
        Started by TradingLoss, 04-21-2024, 04:32 PM
        4 responses
        44 views
        2 likes
        Last Post TradingLoss  
        Started by cre8able, 04-17-2024, 04:16 PM
        6 responses
        57 views
        0 likes
        Last Post cre8able  
        Working...
        X