• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Get 2 values from MACD

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

    Get 2 values from MACD

    Hi, I am working on a strategy to get values from both MACD lines to get the crossover, this is not NS code, just an example: MACD(line A) crossesbelow MACD(Line B).

    How can I get the number of each MACD lines?

    Thanks, Marcelo

    #2
    Hello

    Thanks for your post.

    With reference to this help guide page: https://ninjatrader.com/support/help...gence_macd.htm

    // Prints the current MACD value
    double value = MACD(12, 26, 9)[0];
    Print("The current MACD value is " + value.ToString());

    // Prints the current MACD average value
    double value = MACD(12, 26, 9).Avg[0];
    Print("The current MACD average value is " + value.ToString());

    // Prints the current MACD difference value (this is the Histogram plot)
    double value = MACD(12, 26, 9).Diff[0];
    Print("The current MACD difference value is " + value.ToString());
    Paul H.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by gbulle, Today, 01:17 PM
    3 responses
    13 views
    0 likes
    Last Post gbulle
    by gbulle
     
    Started by CougarMountain, Today, 03:55 PM
    0 responses
    4 views
    0 likes
    Last Post CougarMountain  
    Started by syxforex, Today, 01:13 PM
    3 responses
    12 views
    0 likes
    Last Post NinjaTrader_PaulH  
    Started by pjsmith, Today, 01:17 PM
    2 responses
    6 views
    0 likes
    Last Post pjsmith
    by pjsmith
     
    Started by syxforex, Today, 01:17 PM
    2 responses
    6 views
    0 likes
    Last Post syxforex  
    Working...
    X