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
    DierkNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by wooofad, Today, 05:38 PM
    0 responses
    4 views
    0 likes
    Last Post wooofad
    by wooofad
     
    Started by caacapital, Today, 10:10 AM
    1 response
    15 views
    0 likes
    Last Post NinjaTrader_ShawnB  
    Started by DiverG20, Today, 10:23 AM
    0 responses
    22 views
    0 likes
    Last Post DiverG20  
    Started by SuneSorgenfrei, Today, 09:29 AM
    0 responses
    22 views
    0 likes
    Last Post SuneSorgenfrei  
    Started by dodoei, Today, 07:24 AM
    0 responses
    14 views
    0 likes
    Last Post dodoei
    by dodoei
     
    Working...
    X