PureBytes Links
Trading Reference Links
|
hello,
i want to create an indicator (index) which take on
account 120 data, but we can just use 50 data for 1
window.so i use PUSHPOP to sum the 3 window, because
in the first window i put 50 data, the second 50 and
the third 20 data.
so i create 3 indicators, everyone concern 1 window
and a fourth which sum the 3 others.
but it doesn't work because my indicator which sum the
3 others plot a line on 0.
here is the code of my 4 indicators:
indic1:
inputs:length(5);
vars:break_haut(0),ctr(0),MM_BREAK1(0);
ctr=0;
value1=highest(high,length)[1] of data1;
value2=highest(high,length)[1] of data2;
.
.
value50=highest(high,length)[1] of data50;
if c of data1>value1 then ctr=ctr+1 else ctr=ctr+0;
if c of data2>value2 then ctr=ctr+1 else ctr=ctr+0;
.
.
if c of data50>value50 then ctr=ctr+1 else ctr=ctr+0;
break_haut=ctr;
MM_BREAK1=average(break_haut,20);
plot1(MM_BREAK1," MTA+haut",red,default,1.4);
DefineDLLFunc: "PUSHPOP.DLL", VOID, "PUSH", LONG,
LONG, LONG, DOUBLE;
DefineDLLFunc: "PUSHPOP.DLL", VOID, "PUSHCLEAN", LONG;
Input: Base#(1000);
If CurrentBar=1 Then Begin
PushClean(Base#+1);
End;
PUSH(Base#+1,DATE,TIME,MM_BREAK1);
here i push the indic1 in the base
indic2:
inputs:length(5);
vars:break_haut(0),ctr(0),MM_BREAK2(0);
ctr=0;
value1=highest(high,length)[1] of data1;
value2=highest(high,length)[1] of data2;
.
.
value50=highest(high,length)[1]of data50;
if c of data1>value1 then ctr=ctr+1 else ctr=ctr+0;
if c of data2>value2 then ctr=ctr+1 else ctr=ctr+0;
.
.
if c of data50>value50 then ctr=ctr+1 else ctr=ctr+0;
break_haut=ctr;
MM_BREAK2=average(break_haut,20);
plot1(MM_BREAK2," MTA+haut",red,default,1.4);
DefineDLLFunc: "PUSHPOP.DLL", VOID, "PUSH", LONG,
LONG, LONG, DOUBLE;
DefineDLLFunc: "PUSHPOP.DLL", VOID, "PUSHCLEAN", LONG;
Input: Base#(1000);
If CurrentBar=1 Then Begin
PushClean(Base#+2);
End;
PUSH(Base#+2,DATE,TIME,MM_BREAK2);
here i push the indic2 in the same base.
indic3:
inputs:length(5);
vars:break_haut(0),ctr(0),MM_BREAK3(0);
ctr=0;
value1=highest(high,length)[1] of data1;
.
.
value20=highest(high,length)[1] of data20;
if c of data1>value1 then ctr=ctr+1 else ctr=ctr+0;
.
.
if c of data20>value20 then ctr=ctr+1 else ctr=ctr+0;
break_haut=ctr;
MM_BREAK3=average(break_haut_5j,20);
plot1(MM_BREAK3," MTA+haut",red,default,1.4);
DefineDLLFunc: "PUSHPOP.DLL", VOID, "PUSH", LONG,
LONG, LONG, DOUBLE;
DefineDLLFunc: "PUSHPOP.DLL", VOID, "PUSHCLEAN", LONG;
Input: Base#(1000);
If CurrentBar=1 Then Begin
PushClean(Base#+3);
End;
PUSH(Base#+3,DATE,TIME,MM_BREAK3);
(here i push the indic3 in the sae base)
indic4:
vars:sum_MM_BREAK(0);
Input: Base#(1000);
DefineDLLFunc: "PUSHPOP.DLL", DOUBLE, "POP", LONG,
LONG, LONG;
Vars:MP(0),ep(0);
sum_MM_BREAK=POP(Base#+1,DATE,TIME)+POP(Base#+2,DATE,TIME)+POP(Base#+3,DATE,TIME);
plot1(sum_MM_BREAK,"mm");
here indic4 sum the 3 others.
but don't work.
please help me if you understand the problem.
thanks
tierre2015@xxxxxxxx
|