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 minds2010, Today, 03:38 AM
    1 response
    11 views
    0 likes
    Last Post NinjaTrader_Jesse  
    Started by DTSSTS, Yesterday, 07:11 PM
    2 responses
    32 views
    0 likes
    Last Post NinjaTrader_Jesse  
    Started by ntbone, Yesterday, 11:42 PM
    1 response
    17 views
    0 likes
    Last Post NinjaTrader_PaulH  
    Started by mr_trade, 11-26-2020, 05:01 PM
    5 responses
    59 views
    0 likes
    Last Post mr_trade  
    Started by evanp90, 01-14-2021, 07:03 PM
    4 responses
    33 views
    0 likes
    Last Post NinjaTrader_Jesse  
    Working...
    X