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 argusthome, 03-08-2026, 10:06 AM
    0 responses
    85 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    47 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    29 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    32 views
    0 likes
    Last Post TheRealMorford  
    Started by Mindset, 02-28-2026, 06:16 AM
    0 responses
    67 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Working...
    X