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 GussJ, 03-04-2020, 03:11 PM
    16 responses
    3,281 views
    0 likes
    Last Post Leafcutter  
    Started by WHICKED, Today, 12:45 PM
    2 responses
    19 views
    0 likes
    Last Post WHICKED
    by WHICKED
     
    Started by Tim-c, Today, 02:10 PM
    1 response
    9 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by Taddypole, Today, 02:47 PM
    0 responses
    5 views
    0 likes
    Last Post Taddypole  
    Started by chbruno, 04-24-2024, 04:10 PM
    4 responses
    53 views
    0 likes
    Last Post chbruno
    by chbruno
     
    Working...
    X