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());

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Mindset, 04-21-2026, 06:46 AM
    0 responses
    88 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by M4ndoo, 04-20-2026, 05:21 PM
    0 responses
    134 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by M4ndoo, 04-19-2026, 05:54 PM
    0 responses
    68 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by cmoran13, 04-16-2026, 01:02 PM
    0 responses
    119 views
    0 likes
    Last Post cmoran13  
    Started by PaulMohn, 04-10-2026, 11:11 AM
    0 responses
    67 views
    0 likes
    Last Post PaulMohn  
    Working...
    X