Possible to see a progress bar while backtesting?

Questions about MultiCharts and user contributed studies.
M747
Posts: 25
Joined: 05 Feb 2016
Has thanked: 12 times
Been thanked: 2 times

Possible to see a progress bar while backtesting?

Postby M747 » 05 Feb 2016

While waiting for a backtest to finish, is it possible to see a progress bar of some sort showing how close the backtest is to finishing?

I ask, because I have some signals that are very GPU intensive and take a long time (10+ minutes) for MC to backtest.
Would be great to be able to know how close the backtest is to completion while waiting for it to complete.

Thanks!

evdl
Posts: 401
Joined: 19 Jan 2011
Location: Netherlands
Has thanked: 85 times
Been thanked: 124 times

Re: Possible to see a progress bar while backtesting?

Postby evdl » 06 Feb 2016

Not a progress bar, but I use some code in the signal that will send processed date and time and result to an indicator. The indicator is plotting a textbox with this information. In this way you can see on which date and time the strategy is at the moment.

Put this code in your signal:

Code: Select all

// SYSTEM STATUS ===============
{Put this section in your signal

// current date in strategy
GVSetNamedFloat("Date Strat", Date); // send processed date in strategy to indicator

// current time in strategy
GVSetNamedFloat("Time Strat", Time_s); // send processed time in strategy to indicator

// current result in strategy
GVSetNamedFloat("Result Strat", i_Closedequity); // send result of strategy to indicator
Make an new indicator with this code and use the indicator on a chart of your choice. With the inputs you can change the location on the chart.

Code: Select all

// SYSTEM STATUS ===============
{Put this section in an indicator}

Inputs:
Systemstatus_OffSetHorizontal(250), // position on chart horizontal
Systemstatus_OffSetVertical(0.10), // position on chart vertical
SystemStatus_text_FontSize(10), // font size of text on chart
SystemStatus_text_FontName("Lucida console"), // font type of text on chart
SystemStatus_text_DisplayBorder(True), // border of textbox
SystemStatus_text_BGColor(blue), // background color of textbox
SystemStatus_text_FontColor(white); // font color of text on chart

Vars:
Intrabarpersist DateProcessedByStrat(0),
Intrabarpersist TimeProcessedByStrat(0),
Intrabarpersist ResultOfStrat(0),
Message(999),
Intrabarpersist Txtstr_SystemStatus(""),
Intrabarpersist Boxstr_SystemStatus(""),
Intrabarpersist TextObj_systemStatus(0),
Intrabarpersist Textobj_SystemStatus_Horizontal(0),
Intrabarpersist Textobj_SystemStatus_vertical(0);

Vars: // overall location variabels
Intrabarpersist ScreenValHighest(0),
Intrabarpersist ScreenValLowest(0),
Intrabarpersist ScreenBeginTime(0),
Intrabarpersist ScreenEndTime(0),
OneMinuteDT(ELTimeToDateTime(1)); // 1 minute time unit


// location on screen
ScreenValHighest = GetAppInfo(aiHighestDispValue); // Highest price on the screen
ScreenValLowest = GetAppInfo(aiLowestDispValue); // Lowest price on the screen
ScreenBeginTime = GetAppInfo(aiLeftDispDateTime); // first date and time on screen
ScreenEndTime = GetAppInfo(aiRightDispDateTime); // last date and time on screen


// current date in strategy
DateProcessedByStrat = GVGetNamedFloat("Date Strat", message); // receive processed date in strategy from signal

// current time in strategy
TimeProcessedByStrat = GVGetNamedFloat("Time Strat", message); // receive processed time in strategy from signal

// current result in strategy
ResultOfStrat = GVGetNamedFloat("Result Strat", message); // receive result of strategy from signal


// text to plot

// Textbox
Txtstr_SystemStatus = Text("System Status", spaces(2),newline, newline,
"Date processed ", spaces(2),formatdate("dd/MM/yyyy",datetojulian(DateProcessedByStrat)), newline,
"Time processed ", spaces(2),formattime("HH:mm:ss", el_timetodatetime_s(TimeProcessedByStrat)), newline,
"Result Strategy", spaces(2), Numtostr(ResultOfStrat,2) );

Boxstr_SystemStatus = Text(Txtstr_Systemstatus);


// TextBox formatting
value1 = Text_SetStyle(TextObj_systemStatus, 1, 0);
value2 = Text_SetFontName(TextObj_systemStatus, systemStatus_text_FontName);
value3 = Text_SetBorder(TextObj_systemStatus, systemStatus_text_DisplayBorder);
value4 = Text_SetSize(TextObj_systemStatus, systemStatus_text_FontSize);
value5 = Text_SetBGColor(TextObj_systemStatus, systemStatus_text_BGColor);
value6 = Text_SetColor(TextObj_systemstatus, systemStatus_text_FontColor);

// Set location
Textobj_SystemStatus_horizontal = datetime2eltime(ScreenBeginTime + (OneminuteDT * Systemstatus_OffSetHorizontal)); // move horizontal from left of screen
Textobj_SystemStatus_vertical = ScreenValHighest - ((ScreenValHighest - ScreenValLowest) * Systemstatus_OffSetVertical); // move vertical from top of screen

// Create textbox
If (barstatus(1) = 2) then begin
once begin
textobj_SystemStatus = Text_new(Date, Time,0, Text(Boxstr_SystemStatus) );
end;
end;

// Update the textbox location and values
value7 = Text_SetLocation(textobj_SystemStatus, Date,Textobj_SystemStatus_horizontal,Textobj_SystemStatus_vertical);
value8 = Text_SetString(textobj_SystemStatus, Text(Boxstr_SystemStatus) );


recalclastbarafter(1);


Return to “MultiCharts”