Traderji.com - Discussion forum for Stocks Commodities & Forex

Need Help with this AFL

Discuss Need Help with this AFL at the AmiBroker within the Traderji.com - Discussion forum for Stocks Commodities & Forex; Originally Posted by ramash hi ahutosh thanks for your help. it works fine for me ...


Go Back   Traderji.com - Discussion forum for Stocks Commodities & Forex > TOOLS & RESOURCES > Software > AmiBroker

Notices


Advertise Here

Reply
 
Thread Tools
Sponsored Links
  #31  
Old 18th March 2008, 07:50 AM
Member
 
Join Date: Jan 2007
Posts: 78
Thanks: 0
Thanked 0 Times in 0 Posts
Appreciation: 20
ashutosh.krsrivastava is on a distinguished road
Default Re: Need Help with this AFL

Quote:
Originally Posted by ramash View Post
hi ahutosh

thanks for your help. it works fine for me now.

Mean while i developed another system with the following conds.

Buy when

RSI( 14 ) < 50, MACD( 12, 26 ) > 0 and
MA( Close , 4 ) > MA( Close , 17 ) and
MA( Close , 17 ) > EMA( Close , 34 ) and
EMA( Close , 34 ) > MA( Close , 50 ); and vice versa for sell.

i developed the afl and am attaching the same with the chart so far i get.
i have taken only buy1 and sell3 to print as i don't know how should i do this.

i need a buy only when all the ma's cond get satisfied or sell only when all fails. kindly see to this and help me ashutosh. hope am not bugging u much.

ramash
Hi ramash,
try this for your buy and sell conditions:

Code:
RSI14 = RSI(14);
MACD1226 = MACD(12,26);
MA4 = MA(C, 4);
MA17 = MA(C, 17);
EMA34 = EMA(C, 34);
MA50 = MA(C, 50);
Buy = IIf(RSI14 < 50,IIf(MACD1226>0,IIf(MA4 > MA17,IIf(MA17>EMA34,IIf(EMA34>MA50,1,0),0),0), 0),0);
Sell = IIf(RSI14 > 50,IIf(MACD1226<0,IIf(MA4 < MA17,IIf(MA17<EMA34,IIf(EMA34<MA50,1,0),0),0), 0),0);
and change other codes accordingly, i.e. remove all the buy1s, 2s, etc.
Reply With Quote
  #32  
Old 19th March 2008, 04:24 PM
Member
 
Join Date: Mar 2008
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Appreciation: 10
georgecheng is on a distinguished road
Default Re: Need Help with this AFL

I need some advice for this afl, anyone willing to give some advice on how to do it?

1) Condition to buy when the MACD Line cross over the signal line. And Sell after the signal line cross the MACD Line.

2) Next is it possible to buy on the opening of the next bar immediately after the cross over(MACD line cross signal line) and sell on the the opening of the next bar when reach the next crossover(Singal line cross the MACD Line).

Formula of MACD as following
_SECTION_BEGIN("MACD");
r1 = Param( "Fast avg", 12, 2, 200, 1 );
r2 = Param( "Slow avg", 19, 2, 200, 1 );
r3 = Param( "Signal avg", 9, 2, 200, 1 );
Plot( ml = MACD(r1, r2), StrFormat(_SECTION_NAME()+"(%g,%g)", r1, r2), ParamColor("MACD color", colorRed ), ParamStyle("MACD style") );
Plot( sl = Signal(r1,r2,r3), "Signal" + _PARAM_VALUES(), ParamColor("Signal color", colorBlue ), ParamStyle("Signal style") );
Plot( ml-sl, "MACD Histogram", ParamColor("Histogram color", colorBlack ), styleNoTitle | ParamStyle("Histogram style", styleHistogram | styleNoLabel, maskHistogram ) );
_SECTION_END();


Many thanks
Reply With Quote
  #33  
Old 19th March 2008, 07:45 PM
Member
 
Join Date: Mar 2007
Posts: 66
Thanks: 2
Thanked 1 Time in 1 Post
Appreciation: 21
ramash is on a distinguished road
Default Re: Need Help with this AFL

hi ahutosh,

Thanks a lot for the afl. am yet to check it out. will do and tell you how it works. Hope it will solve my query easily.

ramash
Reply With Quote
  #34  
Old 1st April 2008, 07:17 PM
Member
 
Join Date: Mar 2007
Posts: 66
Thanks: 2
Thanked 1 Time in 1 Post
Appreciation: 21
ramash is on a distinguished road
Default Re: Need Help with this AFL

hi ashutosh,

I checked the afl's with my requirements. I find some places misses the signals when i have rsi and macd also in the same condn. Also if i changed the rsi and macd conditions no signals come

keeping these things in mind have made slight changes with only the ma's. But can u tell me what that condn on a whole do as am bit confused with 1 and 0 which u have added

once again thank you for your efforts.

ramash75
Reply With Quote
Sponsored Links


Reply

Bookmarks


Advertise Here


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


All times are GMT +5.5. The time now is 01:26 AM.

Indemnity, Disclaimer & Disclosure Notice:
• By visiting Traderji.com you indicate your acceptance of our Forum Rules Disclaimer & Disclosure and indemnify Traderji.com, its associates and related parties of all claims howsoever resulting from the usage of the forum.
Disclaimer: Trading or investing in stocks & commodities is a high risk activity. Any action you choose to take in the markets is totally your own responsibility. Traderji.com will not be liable for any, direct or indirect, consequential or incidental damages or loss arising out of the use of this information.
Disclosure: The information in this forum is neither an offer to sell nor solicitation to buy any of the securities mentioned herein. The writers may or may not be trading in the securities mentioned.
• All names or products mentioned are trademarks or registered trademarks of their respective owners.
General Content Disclaimer Notice:
In light of our policy of encouraging candid, open exchanges of views and the rapid distribution of information originating from many sources, Traderji.com cannot determine the accuracy of information that may be uploaded to the forum. Opinions, advice and all other information expressed by participants in discussions are those of the author. You rely on such information at your own risk. You are urged to seek professional advice for specific, individual situations and not rely solely on advice or opinions given in the discussions. Since Traderji.com is an open and free discussion forum, any comments made by members of this forum in their posts reflect their own views and not of the owner or administrator of Traderji.com. Thus the owner/administrator indemnify themselves of all claims whatsoever and will not be liable or responsible for any members comments/views in this forum Traderji.com. If you find any objectionable or offensive posts made by members of this forum which you would like to bring to our notice for removal then please Contact Us.
 


Copyright © 2001 - 2008, Traderji.com All Rights Reserved.

Recommended Websites - www.TradersEdgeIndia.com - www.TradingPicks.com - www.MasterOfTrading.com