PureBytes Links
Trading Reference Links
|
Graham and Gary thanks for your inputs.
Graham - your daily weekly works great that is just what I wanted. I
wanted the buy/sell signal to appear on the graph from any afl code
not just one particular case. Gary's suggestion of putting in the
code into the built-in price with Use Formala Only allowed the
buy/sell signal to work with all afl code.
Thanks again.
Marty
Revised code to be place into Built-in Price with "Use Formala Only"
click on
MAPeriod1=Param("MAl",20,5,50,2);
MAPeriod2=Param("MA2",50,50,100,20);
MAPeriod3=Param("MA3",100,100,300,50);
MA1=MA(Close,MAPeriod1);
MA2=MA(Close,MAPeriod2);
MA3=MA(Close,MAPeriod3);
MAdiff=MA1-MA2;
Volsum30 = Sum( Volume, 30)/30; // volume sum of the last 30 days
Volup50 = Volume > (Volsum30 *.5 + Volsum30) ; // flag for volume up
50%
Volpercent = (Volume - Volsum30 )/Volume *100; //volume percent
change today versus the last 30 day average
Plot
(Close,"C",colorBlack,styleCandle|styleOwnScale|styleLeftAxisScale,5,5
00
);
Plot(MA1,"",colorRed,1|styleOwnScale|styleLeftAxisScale,5,500);
Plot(MA2,"",colorBlue,1|styleOwnScale|styleLeftAxisScale,5,500);
Plot(MA3,"",colorGreen,1|styleOwnScale|styleLeftAxisScale,5,500);
Plot(MAdiff,"",colorGreen,styleNoLine|styleOwnScale|styleNoLabel);
Plot(V,"",IIf(C>=Ref
(C,1),colorBlue,colorRed),styleHistogram|styleOwnScale );
gain = (C-Ref(Close,-1))/C *100;
Title =
WriteIf(Interval()==86400, "Daily", WriteIf(Interval()
==432000, "Weekly",
WriteIf(Interval()==2160000, "Monthly", "")))
+ ", Open " + O+ ", High " +H+ ", Low " +L+
", Close " +C+ "("+WriteVal(gain, format =1.1)+"%) Vol " + WriteVal
(Volume, format= 1.0)+"("+WriteVal(Volpercent,format=1.2) +"%)";
--- In amibroker@xxxxxxxxxxxxxxx, "prog200" <prog200@xxxx> wrote:
> Does anyone have an idea on how to add the following two items to a
> new price indicator?
>
> 1)Get the buy/sell signals to appear on this new price indicator
like
> the built-in one does.
>
> 2) Have the date to change from daily to weekly.
>
> Here is the code I have to far.
>
> MAPeriod1=Param("MAl",20,5,50,2);
> MAPeriod2=Param("MA2",50,50,100,20);
> MAPeriod3=Param("MA3",100,100,300,50);
> MA1=MA(Close,MAPeriod1);
> MA2=MA(Close,MAPeriod2);
> MA3=MA(Close,MAPeriod3);
> MAdiff=MA1-MA2;
>
> Plot
>
(Close,"C",colorBlack,styleCandle|styleOwnScale|styleLeftAxisScale,5,5
> 00);
> Plot(MA1,"",colorRed,1|styleOwnScale|styleLeftAxisScale,5,500);
> Plot(MA2,"",colorBlue,1|styleOwnScale|styleLeftAxisScale,5,500);
> Plot(MA3,"",colorGreen,1|styleOwnScale|styleLeftAxisScale,5,500);
> Plot(MAdiff,"",colorGreen,styleNoLine|styleOwnScale|styleNoLabel);
> Plot(V,"",IIf(C>=Ref
> (C,1),colorBlue,colorRed),styleHistogram|styleOwnScale );
>
> Title = " date " +Date() + ", Open " + O+ ", High " +H+ ", Low "
+L+
> ", Close " +C+ " Vol(" + WriteVal(Volume, format= 1.0)+")";
>
> I could not figure out how to add the color bars to the built-in
> price indicator that is why I created a new one.
>
> Thanks
>
> Marty
------------------------ 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
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/amibroker/
<*> To unsubscribe from this group, send an email to:
amibroker-unsubscribe@xxxxxxxxxxxxxxx
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
|