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, 05-11-2026, 05:56 AM
    0 responses
    25 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 05-10-2026, 08:12 PM
    0 responses
    19 views
    0 likes
    Last Post CarlTrading  
    Started by Hwop38, 05-04-2026, 07:02 PM
    0 responses
    182 views
    0 likes
    Last Post Hwop38
    by Hwop38
     
    Started by CaptainJack, 04-24-2026, 11:07 PM
    0 responses
    335 views
    0 likes
    Last Post CaptainJack  
    Started by Mindset, 04-21-2026, 06:46 AM
    0 responses
    260 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Working...
    X