Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Specific results in the output window

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

    Specific results in the output window

    I need some guidance on how to get specific results in the output window when performing a backtest.

    1) Print “Stock Symbol” and “Date and time” ONLY when some code is TRUE.

    2) Print a simple calculation based on data from the time of the true result from step #1.

    Ex. - Closing price from one bar ago multiplied by 1.66


    I am backtesting hundreds of stocks and I am hoping only to see “true” results in the output window for the time period tested. (Sifting though all of the false results is unwieldy .)
    Last edited by ArmKnuckle; 11-25-2016, 10:12 PM.

    #2
    Hello,

    Thank you for the post.

    You would need to utilize the Print command and some simple conditions for this.

    I am unsure what specific conditions you want but one example could be the close greater than the open:

    Code:
    if(Close[0] > Open[0])
    {
        Print("");
    }
    To know what instrument produced the print you could reference the Instrument object:

    Code:
    Print(Instrument.FullName);
    To add the Time, you can reference the Time object and Append that to the instrument name:

    Code:
    Print(Instrument.FullName + " " + Time[0]);
    To append a calculation to this, you could do something like the following:

    Code:
    if(Close[0] > Open[0])
    {
        Print(Instrument.FullName + " " + Time[0] + " " + Close[1] * 1.66);
    }

    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by samish18, Yesterday, 04:01 AM
    4 responses
    22 views
    0 likes
    Last Post samish18  
    Started by asd32, Today, 11:45 AM
    2 responses
    18 views
    0 likes
    Last Post asd32
    by asd32
     
    Started by GonzaloTradingSystems, Today, 05:30 AM
    1 response
    19 views
    0 likes
    Last Post GonzaloTradingSystems  
    Started by styvenrutchell, Today, 12:42 PM
    0 responses
    7 views
    0 likes
    Last Post styvenrutchell  
    Started by tkaboris, Today, 11:09 AM
    1 response
    7 views
    0 likes
    Last Post NinjaTrader_Jesse  
    Working...
    X