:-)

On 8/19/2010 6:15 AM, Keith McCombs wrote:

DownTrend = (totalscore < -40 AND totalscore *>*= -99);

On 8/18/2010 20:32, Mubashar Virk wrote:

Hi All,

There is an error in the following code that I am somehow not able to fix. While running the explorer The "Score" and "Trend" columns match till I get a score of -60..... the corresponding Trend colums show a blank instead of showing downtrend.

I have highlighted the possible error area in bold. Please help.


////////////////////////////////////////////////
//uptrend
event1 = IIf(C > MA(C,20),20,0);
event3 = IIf(C>MA(C,50),35,0);
event5 = IIf(C>MA(C,200),45,0);

// downtrend
event2 = IIf(C < MA(C,20),-20,0);
event4 = IIf(C < MA(C,50),-35,0);
event6 = IIf(C < MA(C,200),-45,0);

totalscore = event1 + event2 + event3 + event4 + event5 + event6;

//Plot(totalscore, "" , colorRed);

Filter = 1;

AddColumn (totalscore , "Score", 1.0);

*StrongUpTrend = totalscore == 100;
Neutral = (totalscore > -40 AND totalscore < 40);
Uptrend = (totalscore > 40 AND totalscore <= 99);
DownTrend = (totalscore < -40 AND totalscore <= -99);
StrongDownTrend = totalscore == -100;*


Trend =
WriteIf(StrongUpTrend , "Strong UpTrend ",
WriteIf(Neutral , "Neutral ",
WriteIf(Uptrend , "Uptrend ",
WriteIf(DownTrend , "DownTrend ",
WriteIf(StrongDownTrend , "Strong DownTrend",
"")))));

AddTextColumn(Trend, "Trend", 5.6);
//////////////////////////////////////////////////////


On 8/8/2010 4:35 PM, Mubashar Virk wrote:

Hi Ford,
I think I have removed the silly error now. Please see the attachments.
I am an EOD Trader and this scoring idea seems nice to me.
Mav


On 8/8/2010 2:32 PM, ford7k wrote:

Mr Mubashar virk

Many thanks for this superfast reply.
Real kind of you to provide me the code
you have separated trend in a good way
warm regards
keep your spirit up
ford
ps
please refer to
following
I am sure you must be well aware of it.
==========================================================
/* Formula Name: Trend Exploration: Slope Moving Average
Author/Uploader: marcus - marcusdavidsson
Date/Time added: 2009-09-20 06:38:06
Origin:
Keywords:
Level: basic
Flags: exploration
==========================================================
take care

--- In amibroker@yahoogroups.com <mailto:amibroker%40yahoogroups.com>, Mubashar Virk <mvir...@...> wrote:
>
> //uptrend
> event1 = IIf(C > MA(C,20),20,0);
> event3 = IIf(C>MA(C,50),35,0);
> event5 = IIf(C>MA(C,200),45,0);
>
> // downtrend
> event2 = IIf(C < MA(C,20),-20,0);
> event4 = IIf(C < MA(C,50),-35,0);
> event6 = IIf(C < MA(C,200),-45,0);
>
> totalscore = event1 + event2 + event3 + event4 + event5 + event6;
>
> // Plot(totalscore, "" , colorRed);
>
> Filter = 1;
>
> AddColumn (totalscore , "Score", 1.0);
>
> Trend =
> WriteIf(totalscore == 100, "Strong Uptrend",
> WriteIf(totalscore >= -40 OR totalscore <= 40 OR totalscore > 0 AND
> totalscore <= 40, "Neutral", // this argument needs to be written more
> accurately.
> WriteIf(totalscore > 40 AND totalscore <= 99, "Uptrend",
> WriteIf(totalscore < -40 AND totalscore <= -99, "Downtrend",
> WriteIf(totalscore == -100, "Strong Down Trend",
> "")))));
>
> On 8/8/2010 10:43 AM, ford7k wrote:
> >
> >
> > Hi afl experts
> >
> > I am trying to make an afl code.
> > This code uses points alloted to each event like
> > price above 20dma =20,
> > price above 50dma=35 pointr,
> > price goes above 200=45 points.
> >
> > if the opposite happens,score is negative,
> > price cross below 20ma= -20 points
> > price cross below 50ma = -35 points
> > price cross below 200dma = -45 points
> >
> > I like to see the total score at current time or current day or anyday
> > on screen or in exploration
> >
> > Can I try this way
> > event1
> > iif(c > ma(c,20),20,0);
> > event3
> > iif(c>ma(c,50),35,0);
> > event5
> > iif(c>ma(c,200),45,0);
> >
> > event2
> > iif(c < ma(c,20),-20,0);
> > event4
> > iif(c < ma(c,50),-35,0);
> > event6
> > iif(c <ma(c,200),-45,0);
> >
> > total score =
> > example
> > currently event1 occured,event3 occured and event6 occured
> > the score is =5
> > current total score = 20+30+(-45) =5 means mild uptrend or neutral
> >
> > suppose
> > event1 + event2 +event 3 occured then
> > total score =20+35+45=100 strong uptrend occured
> > time to initiate longs
> > suppose
> > event2 +event4+event6 occured,
> > we get total score =-100 strong downtrend-time to initiate shorts
> >
> > the score summation was used in,Mr Hiutels against all odds. afl
> >
> > I just gave the line of my thinking
> > please give some help
> >
> > regards
> > thanks
> > ford
> >
> >
>





Reply via email to