Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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 puapwr, Today, 06:09 PM
    0 responses
    4 views
    0 likes
    Last Post puapwr
    by puapwr
     
    Started by franciscog21, Today, 05:27 PM
    0 responses
    7 views
    0 likes
    Last Post franciscog21  
    Started by hdge4u, 04-29-2024, 12:23 PM
    5 responses
    28 views
    0 likes
    Last Post MisterTee  
    Started by llanqui, 01-25-2024, 06:15 PM
    9 responses
    65 views
    0 likes
    Last Post MisterTee  
    Started by tradingnasdaqprueba, 05-07-2024, 03:42 AM
    16 responses
    67 views
    0 likes
    Last Post tradingnasdaqprueba  
    Working...
    X