AFL CODE: simple downtrend, I am wrong! :(

#1
Hello,

I have tried to make just a simple downtrend: I tried to make 3 red bars, but its not working. If someone could please correct me, I know its an amateur question but i'm still learning.

Buy= C< Ref(C,-1) AND Ref(C,-1) < Ref(C,-2) AND Ref(C,-2) < Ref(C,-3);/// I thought this would make a downtrend but I was wrong.

I then tried this one ( but it also did not work):>

downtrend= C>O and C>L; // red bar
Buy= downtrend< Ref(C,-1) AND Ref(downtrend,-1) < Ref(C,-2) AND Ref(downtrend,-2) < Ref(C,-3);

I don't expect you to write the code for me, just nudge me in the right direction please and I will be most grateful.
Kind regards
 

copypasteaee

Humbled by Markets
#2
Buy= L< Ref(L,-1) AND Ref(L,-1) < Ref(L,-2) AND Ref(L,-2) < Ref(L,-3);

decline means lower lows but why do you want to buy there

downtrend= C>O and C>L; // red bar
Red bar is simply C<O (C is always greater than equal to L so has no meaning)

or you can simply write

red_bar= CdBlack(0,0); //red bar
 

Similar threads