[BUG Report] Is this a bug or not?

Questions about MultiCharts and user contributed studies.
2haerim
Posts: 502
Joined: 01 Sep 2006
Been thanked: 2 times

[BUG Report] Is this a bug or not?

Postby 2haerim » 05 Apr 2009

Code: Select all

Input : dnbase(-11);
VARS: value1(0),value2(0),value3(0),value4(0),value5(0),value6(0),value7(0);


if d<>d[1] then begin
value1 = 0;
value2 = 0;
condition2 = false;
end;

condition2 = crosses_below(value4,dnbase);

value1 = c of data2;
value2 = c of data3;

if value2=0 then
value2=value2[1];


value3 = (value1 - value2)/value2*100;

value4 = WMA(value3,Period1);
value5 = WMA(value3,Period2);


plot1(value4,"V4");
plot2(dnbase,"db");

if d=1090403 and t>=0920 and t<=0930 then
print(d:8:0,t:8:0, " ", value4[1], dnbase, value4, " ", condition2 );
This code printed the following output:

1090403 920 -10.66 -11.00 -10.02 FALSE
1090403 922 -10.02 -11.00 -9.20 FALSE
1090403 924 -9.20 -11.00 -15.40 FALSE
1090403 926 -15.40 -11.00 -16.59 FALSE
1090403 928 -16.59 -11.00 -22.44 FALSE
1090403 930 -22.44 -11.00 -27.46 FALSE

I think the red line should be TRUE. Am I wrong?

Even if I change the problematic line into:

Code: Select all

condition2 = value4[1]<dnbase and value4>dnbase;
I still got FALSE.
Last edited by 2haerim on 06 Apr 2009, edited 1 time in total.

drwar
Posts: 218
Joined: 31 Jul 2005

Postby drwar » 05 Apr 2009

Whats this ?

Input : dnbase(-11;


J~

2haerim
Posts: 502
Joined: 01 Sep 2006
Been thanked: 2 times

Postby 2haerim » 06 Apr 2009

sorry!

it should be dnbase(-11).

Anyway, the point is whether MC has the bug or not.

SUPER
Posts: 646
Joined: 03 Mar 2007
Has thanked: 106 times
Been thanked: 84 times

Postby SUPER » 06 Apr 2009

2haerim,

Funny enough I tested your code on TS and it produces similar results to yours, both platforms seem to have a problem it seems.

Lets see what TS support has to comment about this issue.

1090403 915 -0.30 -0.36 -0.28 FALSE
1090403 920 -0.28 -0.36 -0.32 FALSE
1090403 925 -0.32 -0.36 -0.39 FALSE
1090403 930 -0.39 -0.36 -0.28 FALSE



Regards
Super

2haerim
Posts: 502
Joined: 01 Sep 2006
Been thanked: 2 times

Postby 2haerim » 06 Apr 2009

Is that so? I didn't know TS also has the same bug.

It's really funny both platforms have the same bug.

I hope MC do not repeat but overcome TS's bugs.

gregorio123456
Posts: 117
Joined: 08 Nov 2005
Been thanked: 3 times

Postby gregorio123456 » 06 Apr 2009

Is that so? I didn't know TS also has the same bug.

It's really funny both platforms have the same bug.

I hope MC do not repeat but overcome TS's bugs.

try this
condition2 = crosses_below(dnbase,value4); is different this
condition2 = crosses_below(value4,dnbase);

and see this in red print(d:8:0,t:8:0, " ", value4[1], dnbase, value4, " ", condition2 ); or (value4,dnbase)

juu

2haerim
Posts: 502
Joined: 01 Sep 2006
Been thanked: 2 times

Postby 2haerim » 06 Apr 2009

gregorio123456,


I tried, but got the same results.

I don't see what is your point.

Can you post your test results?

gregorio123456
Posts: 117
Joined: 08 Nov 2005
Been thanked: 3 times

Postby gregorio123456 » 06 Apr 2009

gregorio123456,


I tried, but got the same results.

I don't see what is your point.

Can you post your test results?
when I post only read your code and don´t test your code.....now I test w change the position of condition2 (this is one suggestion )

I try w MC 4 w google in 3 time frame 1min=data1 15min=data2 10min=data3

Input : dnbase(-0.11);
VARS: value1(0),value2(0),value3(0),value4(0),value5(0),value6(0),value7(0);


if d<>d[1] then begin
value1 = 0;
value2 = 0;
condition2 = false;
end;


value1 = c of data2;
value2 = c of data3;

if value2=0 then
value2=value2[1];


value3 = (value1 - value2)/value2*100;

value4 = Average(value3,5);
value5 = Average(value3,9);


plot1(value4,"V4");
plot2(dnbase,"db");
condition2 =crosses_below(value4,dnbase);

print(d:8:0,t:8:0, " ", value4[1], dnbase, value4, " ", condition2 );

1090305 1504 0.05 -0.11 0.00 FALSE
1090305 1505 0.00 -0.11 0.00 FALSE
1090305 1506 0.00 -0.11 0.00 FALSE
1090305 1507 0.00 -0.11 0.00 FALSE
1090305 1508 0.00 -0.11 0.00 FALSE
1090305 1509 0.00 -0.11 0.00 FALSE
1090305 1510 0.00 -0.11 -0.14 TRUE
1090305 1511 -0.14 -0.11 -0.29 FALSE
1090305 1512 -0.29 -0.11 -0.43 FALSE
1090305 1513 -0.43 -0.11 -0.58 FALSE
1090305 1514 -0.58 -0.11 -0.72 FALSE
1090305 1515 -0.72 -0.11 -0.47 FALSE
1090305 1516 -0.47 -0.11 -0.22 FALSE
1090305 1517 -0.22 -0.11 0.03 FALSE
1090305 1518 0.03 -0.11 0.28 FALSE
1090305 1519 0.28 -0.11 0.53 FALSE
1090305 1520 0.53 -0.11 0.54 FALSE
1090305 1521 0.54 -0.11 0.55 FALSE
1090305 1522 0.55 -0.11 0.56 FALSE
1090305 1523 0.56 -0.11 0.57 FALSE
1090305 1524 0.57 -0.11 0.58 FALSE
1090305 1525 0.58 -0.11 0.58 FALSE
1090305 1526 0.58 -0.11 0.58 FALSE
1090305 1527 0.58 -0.11 0.58 FALSE
1090305 1528 0.58 -0.11 0.58 FALSE
1090305 1529 0.58 -0.11 0.58 FALSE
1090305 1530 0.58 -0.11 0.47 FALSE
1090305 1531 0.47 -0.11 0.35 FALSE
1090305 1532 0.35 -0.11 0.23 FALSE
1090305 1533 0.23 -0.11 0.12 FALSE
1090305 1534 0.12 -0.11 0.00 FALSE
1090305 1535 0.00 -0.11 0.00 FALSE
1090305 1536 0.00 -0.11 0.00 FALSE
1090305 1537 0.00 -0.11 0.00 FALSE
1090305 1538 0.00 -0.11 0.00 FALSE
1090305 1539 0.00 -0.11 0.00 FALSE
1090305 1540 0.00 -0.11 0.17 FALSE
1090305 1541 0.17 -0.11 0.33 FALSE
1090305 1542 0.33 -0.11 0.50 FALSE
1090305 1543 0.50 -0.11 0.67 FALSE
1090305 1544 0.67 -0.11 0.84 FALSE
1090305 1545 0.84 -0.11 0.66 FALSE
1090305 1546 0.66 -0.11 0.49 FALSE
1090305 1547 0.49 -0.11 0.31 FALSE
1090305 1548 0.31 -0.11 0.14 FALSE
1090305 1549 0.14 -0.11 -0.04 FALSE
1090305 1550 -0.04 -0.11 -0.20 TRUE
1090305 1551 -0.20 -0.11 -0.37 FALSE
1090305 1552 -0.37 -0.11 -0.53 FALSE
1090305 1553 -0.53 -0.11 -0.70 FALSE
1090305 1554 -0.70 -0.11 -0.87 FALSE
1090305 1555 -0.87 -0.11 -0.87 FALSE
1090305 1556 -0.87 -0.11 -0.87 FALSE
1090305 1557 -0.87 -0.11 -0.87 FALSE
1090305 1558 -0.87 -0.11 -0.87 FALSE
1090305 1559 -0.87 -0.11 -0.87 FALSE
1090305 1600 -0.87 -0.11 -0.69 FALSE

maybe help you where is the problems....good luck

juu

User avatar
Andrew Kirillov
Posts: 1589
Joined: 28 Jul 2005
Has thanked: 2 times
Been thanked: 31 times
Contact:

Postby Andrew Kirillov » 07 Apr 2009

There is no bug here.
Compare the code of both studies. Can you see a difference?

//
// FIRST
//
once cleardebug;
Input : dnBase(-11);

{-= value1 changed before call crosses_below =-}
if currentbar = 1 then value1 = -10.66;
if currentbar = 2 then value1 = -10.02;
if currentbar = 3 then value1 = -9.20;
if currentbar = 4 then value1 = -15.40;
if currentbar = 5 then value1 = -16.59;

{-= call crosses_below =-}
condition1 = crosses_below(value1, dnBase);

if currentbar > 1 and currentbar <= 6 then
print(currentbar:3:0, " ",value1[1], " ",dnBase, " ",value1, " * ",condition1);

---------
Output
2 -10.66 -11.00 -10.02 * FALSE
3 -10.02 -11.00 -9.20 * FALSE
4 -9.20 -11.00 -15.40 * TRUE
5 -15.40 -11.00 -16.59 * FALSE
6 -16.59 -11.00 -16.59 * FALSE

//
// SECOND
//
once cleardebug;
Input : dnBase(-11);

{-= call crosses_below =-}
condition1 = crosses_below(value1, dnBase);

{-= value1 changed after call crosses_below =-}
if currentbar = 1 then value1 = -10.66;
if currentbar = 2 then value1 = -10.02;
if currentbar = 3 then value1 = -9.20;
if currentbar = 4 then value1 = -15.40;
if currentbar = 5 then value1 = -16.59;

if currentbar > 1 and currentbar <= 6 then
print(currentbar:3:0, " ",value1[1], " ",dnBase, " ",value1, " * ",condition1);

---------
Output
2 -10.66 -11.00 -10.02 * FALSE
3 -10.02 -11.00 -9.20 * FALSE
4 -9.20 -11.00 -15.40 * FALSE
5 -15.40 -11.00 -16.59 * FALSE
6 -16.59 -11.00 -16.59 * FALSE

Haerim calls condition2 = crosses_below(value4,dnbase); first and then changes value4 and traces it.

2haerim
Posts: 502
Joined: 01 Sep 2006
Been thanked: 2 times

Postby 2haerim » 07 Apr 2009

Andrew,

Thank you.

You made me realize how stupid I am.

It works after moving the crosses_below statement after changing value4 variable.


Return to “MultiCharts”