ERROR RENKO IN MULTIFRAME  [SOLVED]

Questions about MultiCharts and user contributed studies.
turbofib
Posts: 213
Joined: 11 May 2013
Has thanked: 67 times
Been thanked: 1 time

ERROR RENKO IN MULTIFRAME

Postby turbofib » 03 Jul 2013

MY PROGRAM :

Code: Select all

var:renko_red_green(0);

if C of data2 crosses over C[1] of data2 then begin //RENKO UP

renko_red_green=2;

end;

if C of data2 crosses under C[1] of data2 then begin //RENKO DOWN

renko_red_green=1;

end;

plot1(renko_red_green);
********************

see the pics below

in the first graph there is a chart renko box size 7 ... 1 tick resolution.

in the second graph there is a chart with 20 points .. under the same chart before renko

in each .. An indicator appears when renko 'red plots 1 ... and when' green plots 2

But there is an error in the chart multiframe .. SEE PICS BELOW
Attachments
renko_2.png
(115.17 KiB) Downloaded 697 times
RENKO1.png
(125.1 KiB) Downloaded 684 times
Last edited by turbofib on 04 Jul 2013, edited 1 time in total.

User avatar
TJ
Posts: 7739
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1032 times
Been thanked: 2221 times

Re: ERROR RENKO IN MULTIFRAME

Postby TJ » 03 Jul 2013

MY PROGRAM :
var:renko_red_green(0);
if C crosses over C[1] then begin //RENKO UP
renko_red_green=2;
end;
if c crosses under C[1] then begin //RENKO DOWN
renko_red_green=1;
end;
plot1(renko_red_green);
********************
see the pics below
in the first graph there is a chart renko box size 7 ... 1 tick resolution.
in the second graph there is a chart with 20 points .. under the same chart before renko
in each .. An indicator appears when renko 'red plots 1 ... and when' green plots 2
But there is an error in the chart multiframe .. SEE PICS BELOW
Please specify where did you apply the code? Which data series?

User avatar
TJ
Posts: 7739
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1032 times
Been thanked: 2221 times

Re: ERROR RENKO IN MULTIFRAME

Postby TJ » 03 Jul 2013

[FAQ] How to Post Codes (that people can read)
viewtopic.php?f=16&t=11713

turbofib
Posts: 213
Joined: 11 May 2013
Has thanked: 67 times
Been thanked: 1 time

Re: ERROR RENKO IN MULTIFRAME

Postby turbofib » 04 Jul 2013

okk

Code: Select all

var:renko_red_green(0);

if C of data2 crosses over C[1] of data2 then begin //RENKO UP
renko_red_green=2;
end;

if C of data2 crosses under C[1] of data2 then begin //RENKO DOWN
renko_red_green=1;
end;
plot1(renko_red_green);


I APPLY a code a futures dax ( symbol ax u3-dt)
intervals are written in chart pics (20 point)

turbofib
Posts: 213
Joined: 11 May 2013
Has thanked: 67 times
Been thanked: 1 time

Re: ERROR RENKO IN MULTIFRAME

Postby turbofib » 06 Jul 2013

I did not understand if I have to report it as a bug in project management...
I have not read any response regarding my problem

User avatar
TJ
Posts: 7739
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1032 times
Been thanked: 2221 times

Re: ERROR RENKO IN MULTIFRAME

Postby TJ » 06 Jul 2013

I did not understand if I have to report it as a bug in project management...
I have not read any response regarding my problem
I have tested your code, the plot performed as expected.

Computer is very dumb, it will do what you tell it to do.
There must be other sections of your code that changed the final behavior on your chart.

turbofib
Posts: 213
Joined: 11 May 2013
Has thanked: 67 times
Been thanked: 1 time

Re: ERROR RENKO IN MULTIFRAME

Postby turbofib » 07 Jul 2013

then probably I have some problems .. but I do not know what information to provide to find them .....
I visualize the code again and a new futur
var:renko_red_green(0);

if C of data2 crosses over C[1] of data2 then begin //RENKO UP
renko_red_green=2;

end;

if C of data2 crosses under C[1] of data2 then begin //RENKO DOWN
renko_red_green=1;
end;

plot1(renko_red_green); futures is : FTMIB 20 point regoular
renko is: ftmib 7 box resolution 1 tick
Attachments
Immagine10.png
(140.73 KiB) Downloaded 675 times

User avatar
TJ
Posts: 7739
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1032 times
Been thanked: 2221 times

Re: ERROR RENKO IN MULTIFRAME  [SOLVED]

Postby TJ » 07 Jul 2013

Go to Format Study

Look under the "Properties" tab,

in the "Base Study on" section,

can you tell me which data you have applied the indicator to?

User avatar
TJ
Posts: 7739
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1032 times
Been thanked: 2221 times

Re: ERROR RENKO IN MULTIFRAME

Postby TJ » 07 Jul 2013

2 points:

1. when you use exclusive conditions, you should use the ELSE keyword.

eg.

Code: Select all

var:renko_red_green(0);

if C of data2 crosses over C[1] of data2 then
begin //RENKO UP
renko_red_green=2;
end
ELSE
if C of data2 crosses under C[1] of data2 then
begin //RENKO DOWN
renko_red_green=1;
end;

plot1(renko_red_green);

2. You have to be careful when using crosses over and crosses under keywords.

When the price crosses over intrabar, the condition is met, and will trigger the variable (1 or 2).
However, if the price reverts back to under c[1] before the end of the bar, the condition might not reverse if you have not coded it properly.

My preferred routine is:

Code: Select all

if C of data2 > C[1] of data2 then
begin //RENKO UP
renko_red_green=2;
end
ELSE
::

turbofib
Posts: 213
Joined: 11 May 2013
Has thanked: 67 times
Been thanked: 1 time

Re: ERROR RENKO IN MULTIFRAME

Postby turbofib » 08 Jul 2013

found the error .... settings study was set to the first rather than the second chart .. (I'm still not an expert on the functionality of MULTICHART)

now works correctly

but I ask you a question: I used to refer to these data2 in the program to chart 2
Why do I have to also point you in the properties?

thanks for the help


Return to “MultiCharts”