Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

MIN (Minimum Value)

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

    MIN (Minimum Value)

    The following returns the highest and lowest values, excluding the CurrentBar.
    It is included inside a for loop that proceeds until condition1 exists and is exited with a goto statement. When conditio1 exists, the sw.Write statement is executed. I want the highest and lowest values since the signal triggered. If the low occurs on the bar where condition1 appeared, it returns the lowest value in the bars preceding the condition1 bar, but not the low of the condition1 bar.

    Here is the gist of the code.

    if(signal[1] == true)
    {
    signalbar = CurrentBar-1;

    for(int i = CurrentBar - signalbar; i <= Count-signalbar ; ++i)//I have tried ++i and i++, but get the same result
    {
    .
    if(condition1 == true)
    sw.Write(",CC,"+MAX(High,CurrentBar-signalbar)[0]+","+MIN(Low,CurrentBar-signalbar)[0]);
    .
    goto exitloop;
    }
    }

    What might I be doing wrong?

    #2
    I suggest debugging your strategy as per here: http://www.ninjatrader-support.com/v...ead.php?t=3418

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    602 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    347 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    103 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    560 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    559 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X