Discovered a bug with MC 8.7.7634 64 bit  [SOLVED]

Questions about MultiCharts and user contributed studies.
champski
Posts: 71
Joined: 28 Jun 2011
Has thanked: 20 times
Been thanked: 1 time

Discovered a bug with MC 8.7.7634 64 bit

Postby champski » 15 Oct 2013

Hi all,

I believe I have discovered a bug since upgrading to MC 8.7.7634 64 bit. I can confirm the following issue does not occur on version 8.5 Release (Build 6851).

I have a chart displaying hourly bars and am using the following code.

Code: Select all

If barstatus(1) = 2 then begin
print("Barnumber=", Barnumber+MaxBarsBack, " Open= ", open:1:5, " Close= ", close:1:5);
End;
This is supposed to printout the open and close values for each bar, but since upgrading to this newer version the open value is incorrect. Instead of printing the first value for the hour, it is printing the value of the first second (see the attachment).

NB. The Data Window on my chart displays the correct open and close values.

I'm using;
- intrabarordergeneration
- Extended backtesting Mode with bid and ask data
- Backtesting Precision is set to use Bar Magnifier, without "Skip ticks with identical prices" enabled.

Regards
Champski
Attachments
Quote Manager - Edit Data.jpg
(27.61 KiB) Downloaded 1121 times

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

Re: Discovered a bug with MC 8.7.7634 64 bit

Postby evdl » 17 Oct 2013

I don't know if its a bug or not and I too remember to get the values of the first bar in the past.

But I found this thread about using symbol_close, symbol_open etc. to get the first bar value.

http://www.multicharts.com/discussion/v ... =1&t=10517

Please be aware if you use references to x bars back with certain functions in your code it will not work.

So you can use for example:

Code: Select all

If date <> date[1] then begin
print("Date:", formatdate("dd-MM-yyyy",eldatetodatetime(Symbol_date[1]))," Open:", symbol_open[1], " Close:", symbol_close[1] );
But you can not use:

Code: Select all

If date <> date[1] then begin
print("Date:", formatdate("dd-MM-yyyy",eldatetodatetime(Symbol_date[1]))," Open:", symbol_open[1], " Close:", closeD(1) );
Because probably the closeD(1) is causing the maxbarsetting to kick back in, which is not the case with the symbol_x functions.

User avatar
Henry MultiСharts
Posts: 9165
Joined: 25 Aug 2011
Has thanked: 1264 times
Been thanked: 2957 times

Re: Discovered a bug with MC 8.7.7634 64 bit

Postby Henry MultiСharts » 17 Oct 2013

Champski, what is the data resolution for Bar Magnifier?

champski
Posts: 71
Joined: 28 Jun 2011
Has thanked: 20 times
Been thanked: 1 time

Re: Discovered a bug with MC 8.7.7634 64 bit

Postby champski » 18 Oct 2013

Hey Henry,

Bar magnifier is set to 1 ticks.

Cheers
Champski

champski
Posts: 71
Joined: 28 Jun 2011
Has thanked: 20 times
Been thanked: 1 time

Re: Discovered a bug with MC 8.7.7634 64 bit

Postby champski » 18 Oct 2013

I don't know if its a bug or not and I too remember to get the values of the first bar in the past.

But I found this thread about using symbol_close, symbol_open etc. to get the first bar value.

http://www.multicharts.com/discussion/v ... =1&t=10517

Please be aware if you use references to x bars back with certain functions in your code it will not work.

So you can use for example:

Code: Select all

If date <> date[1] then begin
print("Date:", formatdate("dd-MM-yyyy",eldatetodatetime(Symbol_date[1]))," Open:", symbol_open[1], " Close:", symbol_close[1] );
But you can not use:

Code: Select all

If date <> date[1] then begin
print("Date:", formatdate("dd-MM-yyyy",eldatetodatetime(Symbol_date[1]))," Open:", symbol_open[1], " Close:", closeD(1) );
Because probably the closeD(1) is causing the maxbarsetting to kick back in, which is not the case with the symbol_x functions.
Thanks evdl,

I compared replacing

Code: Select all

open
with

Code: Select all

symbol_open
in my code and

Code: Select all

symbol_open
returned the correct open value of each bar.

Why is this so?
Is there added risk that other commonly used Keywords are also broken in the latest MC revision.....???

Cheers
Champski

User avatar
Henry MultiСharts
Posts: 9165
Joined: 25 Aug 2011
Has thanked: 1264 times
Been thanked: 2957 times

Re: Discovered a bug with MC 8.7.7634 64 bit  [SOLVED]

Postby Henry MultiСharts » 22 Oct 2013

champski, this issue has been confirmed. The fix is targeted to MultiCharts 8.8 Release


Return to “MultiCharts”