[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [amibroker] Re: Triple Moving Average formula question ??



PureBytes Links

Trading Reference Links

Jmb,
If you were to plot cond1 you would see that it plots either 1 or 0 , the
same will be true for cond2 if you chose to plot a different value you could
see one value "rise" through the next.

Example;

cond1=MA(C,20)>MA(C,35) AND C>MA(C,50);
Cond2=EMA(C,20)>EMA(C,50) AND C>EMA(C,50);

Plot(EMA(C,50),"",IIf(cond2,colorYellow,colorRed),styleArea);
Plot(C,"",IIf(Cond2,colorGreen,colorLightGrey),styleArea);

Note the order you place the plots makes a difference. Try reversing them to
see what I mean. In the example green will fall below the yellow when the
closing value falls below that of its 50 period EMA. Make sense??


Regards,
Jayson
-----Original Message-----
From: jmbruegge [mailto:jmbruegge@xxxxxxxxx]
Sent: Monday, November 24, 2003 1:26 PM
To: amibroker@xxxxxxxxxxxxxxx
Subject: [amibroker] Re: Triple Moving Average formula question ??


Jayson - thank you - I wrote it out but I am having a problem with
the plot part. What do you mean by "Since cond1 returns either a true
or false (1 or 0) you will need to plot a value other than cond1 but
cond1 can be used to trigger the color of your plot" ?

The first condition plots fine, I cannot get the other 3 ?? Any
thoughts ??

thanks, jmb


--- In amibroker@xxxxxxxxxxxxxxx, "Jayson" <jcasavant@xxxx> wrote:
> Jmb,
> You have taken the first step in writing it out in English. Now
just take it
> to next step by coding your thoughts as cond1 cond2 etc....
>
> cond1=ma(c,20)>ma(c,35) AND c>ma(c,50);
>
> from there you should be able to color the plot using IIf.....
>
> plot(X,"Sun",iif(cond1,coloryellow,colorblack),stylearea);
>
> X= your value ,what ever that may be ...try close as an example.
Since cond1
> returns either a true or false (1 or 0) you will need to plot a
value other
> than cond1 but cond1 can be used to trigger the color of your plot..
>
> Regards,
> Jayson
> -----Original Message-----
> From: jmbruegge [mailto:jmbruegge@x...]
> Sent: Monday, November 24, 2003 11:23 AM
> To: amibroker@xxxxxxxxxxxxxxx
> Subject: [amibroker] Triple Moving Average formula question ??
>
>
> I am trying to write a indicator formula similiar to the "Sun and
> Cloud" formula appearance in the AFL formulas area with the
following
> characteristics and am stuck, any ideas ???
>
> 1 - If the 20 day (or week) MA breaks above the 35 day (or week) MA
> AND the price is above the 50 MA  = yellow fill-in (like on sun and
> cloud indicator) or yellow up arrow to be generated.
>
> 2 - If the 20 day (or week) EMA breaks above the 50 day (or week)
EMA
> = green fill-in (like sun and cloud indicator) or green up arrow AND
> the price is above the 50 day (or week) EMA.  (this is a confirmed
> buy signal)
>
> 3 - If the 20 day (or week) EMA breaks BELOW the 35 day (or week)
EMA
> and the price is below the 50 MA = yellow fill-in or yellow down
> arrow.
>
> 4 - If the 20 day (or week) EMA breaks below the 50 day (or week)
EMA
> and price is below the 50 MA = red fill-in or red down arrow.
> (confirmed sell signal)
>
> Any help would be much appreciated !!
>
> cheers -jmb
>
>
>       Yahoo! Groups Sponsor
>             ADVERTISEMENT
>
>
>
>
> Send BUG REPORTS to bugs@xxxx
> Send SUGGESTIONS to suggest@xxxx
> -----------------------------------------
> Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx
> (Web page: http://groups.yahoo.com/group/amiquote/messages/)
> --------------------------------------------
> Check group FAQ at:
> http://groups.yahoo.com/group/amibroker/files/groupfaq.html
>
> Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.


Yahoo! Groups Sponsor



Send BUG REPORTS to bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx
(Web page: http://groups.yahoo.com/group/amiquote/messages/)
--------------------------------------------
Check group FAQ at:
http://groups.yahoo.com/group/amibroker/files/groupfaq.html

Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.



------------------------ Yahoo! Groups Sponsor ---------------------~-->
Buy Ink Cartridges or Refill Kits for your HP, Epson, Canon or Lexmark
Printer at MyInks.com. Free s/h on orders $50 or more to the US & Canada.
http://www.c1tracking.com/l.asp?cid=5511
http://us.click.yahoo.com/mOAaAA/3exGAA/qnsNAA/GHeqlB/TM
---------------------------------------------------------------------~->

Send BUG REPORTS to bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx 
(Web page: http://groups.yahoo.com/group/amiquote/messages/)
--------------------------------------------
Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/