Hi guys,
does anyone ever tried to code in AFL something like in subject.

I'm trying to split volumes on a 1 min TimeFrame according to a very
simple criteria that is:
positive volume --> if the 1 minute bar has C>O
negative volume --> if the 1 minute bar has C<O
and once I get the new arrays, use them in higher TFs.

I was thinking that TimeFrameCompress function would help me, but I
can't make it work out.
Many thanks in advance to anyone that will help me in understanding
and solving this matter.


Here is one of my several trial codes:


TFinuse= 5;
barStartTime = TimeNum();

TimeFrameSet(in1Minute);

        Vol5p= IIf(frac(TimeNum()/100/5)==0, Sum(IIf(C>O, V, 0), 5), 0);

        Volpos = Sum(IIf(C>O, V, 0),TFinuse);
        Volneg = Sum(IIf(C<O, V, 0),TFinuse);

        VolposTF = TimeFrameCompress(Volpos,TFinuse,compressLast);
        VolnegTF = TimeFrameCompress(Volneg,TFinuse,compressLast);

TimeFrameRestore();

Volsum = VolposTF + VolnegTF ;

"TF in use = " +TFinuse;
"barStartTime = " +barStartTime ;
"Volpos = " + VolposTF;
"Volneg = " + VolnegTF;
"Volsum = " + Volsum ;
"V = " +V;

Filter=C>0;
AddColumn(Volume,"Volume");
AddColumn(VolposTF,"Vol+");
AddColumn(VolnegTF,"Vol-");
AddColumn(Vol5p,"Vol5p");
AddColumn(TFinuse,"TFinuse");

Reply via email to