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.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by CarlTrading, 03-31-2026, 09:41 PM
    1 response
    40 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 04-01-2026, 02:41 AM
    0 responses
    20 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 03-31-2026, 11:44 PM
    0 responses
    27 views
    1 like
    Last Post CaptainJack  
    Started by CarlTrading, 03-30-2026, 11:51 AM
    0 responses
    44 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 03-30-2026, 11:48 AM
    0 responses
    37 views
    0 likes
    Last Post CarlTrading  
    Working...
    X