Traderji.com - Discussion forum for Stocks Commodities & Forex

AFL required

Discuss AFL required at the AmiBroker within the Traderji.com - Discussion forum for Stocks Commodities & Forex; Can any body provide an AFL for the following metastock expert , found it from ...


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

Notices


Advertise Here

Reply
 
Thread Tools
Sponsored Links
  #1  
Old 9th October 2008, 05:11 PM
Member
 
Join Date: Jul 2007
Posts: 25
Thanks: 0
Thanked 1 Time in 1 Post
mmca2006 is on a distinguished road
Reputation: 21
Default AFL required

Can any body provide an AFL for the following metastock expert , found it from website of E q u I s based on Trix ( MetaStock Tips & Tricks > 2004 > When and When not to Trade) --

Code:
Gold Cross(GC)=

tx:=TRIX(5);
sig:=Mov(tx,3,E);
Cross(tx,sig)


Dead Cross(DC)=

tx:=TRIX(5);
sig:=Mov(tx,3,E);
Cross(sig,tx)

Bounce(B)=

tx:=TRIX(5);
Cross(ROC(tx,1,$),0)


Fall(F)=

tx:=TRIX(5);
Cross(0,ROC(tx,1,$))
Want an AFL with Buy(GC), Sell ( DC), bounce (B) , Fall (F) signal , if possible with exploration also. Please...
Reply With Quote
Sponsored Links
  #2  
Old 11th October 2008, 02:25 PM
Member
 
Join Date: Oct 2007
Posts: 241
Thanks: 10
Thanked 91 Times in 53 Posts
Adheer will become famous soon enoughAdheer will become famous soon enough
Reputation: 111
Default Re: AFL required

Here is the exploration :

Code:
tx = Trix(5);
sig = EMA(tx,3);

gc = Cross(tx,sig);
dc = Cross(sig, tx);
bounce = Cross(ROC(tx, 1), 0);
fall = Cross(0, ROC(tx,1));

percChange = 100*C/Ref(C,-1)-100;

Filter = (sig == True) OR (dc == True) OR (bounce == True) OR (fall == True);
AddColumn(C, "Close", 8.2);
AddColumn(percChange, "% Change", 8.1, IIf(percChange > 0, colorGreen, IIf(perCChange <0, colorRed,colorDefault)));
AddColumn(gc,     "Gold Cross", 1.0, colorDefault, IIf( gc==True, colorGreen, colorDefault));
AddColumn(dc,     "Dead Cross", 1.0, colorDefault, IIf( dc==True, colorRed, colorDefault));
AddColumn(bounce, "Bounce",     1.0, colorDefault, IIf( bounce==True, colorSeaGreen, colorDefault));
AddColumn(fall,   "Fall",       1.0, colorDefault, IIf( fall==True, colorOrange, colorDefault));
Reply With Quote
  #3  
Old 11th October 2008, 02:36 PM
Member
 
Join Date: Oct 2007
Posts: 241
Thanks: 10
Thanked 91 Times in 53 Posts
Adheer will become famous soon enoughAdheer will become famous soon enough
Reputation: 111
Default Re: AFL required

And here is the indicator :

Color Legend :
Gold Cross - Blue Up Triangle
Dead Cross - Red Down Triangle
Bounce - Light Green Up Triangle
Fall - Orange Down Triangle

Code:
tx = Trix(5);
sig = EMA(tx,3);

gc = Cross(tx,sig);
dc = Cross(sig, tx);
bounce = Cross(ROC(tx, 1), 0);
fall = Cross(0, ROC(tx,1));

PlotShapes(IIf(gc==True, shapeSmallUpTriangle, shapeNone), IIf(gc==True, colorBlue, colorDefault), 0, Low, -20);
PlotShapes(IIf(dC==True, shapeSmallDownTriangle, shapeNone), IIf(dC==True, colorRed, colorDefault), 0, High, -20);
PlotShapes(IIf(bounce==True, shapeSmallUpTriangle, shapeNone), IIf(bounce==True, colorSeaGreen, colorDefault), 0, Low, -40);
PlotShapes(IIf(fall==True, shapeSmallDownTriangle, shapeNone), IIf(fall==True, colorOrange, colorDefault), 0, High, -40);
Reply With Quote
The Following User Says Thank You to Adheer For This Useful Post:
HBBHVN (13th October 2008)
  #4  
Old 13th October 2008, 04:51 PM
Member
 
Join Date: Jul 2007
Posts: 25
Thanks: 0
Thanked 1 Time in 1 Post
mmca2006 is on a distinguished road
Reputation: 21
Default Re: AFL required

Thanks lot
Reply With Quote
  #5  
Old 2nd November 2008, 04:58 PM
Member
 
Join Date: Jul 2007
Posts: 25
Thanks: 0
Thanked 1 Time in 1 Post
mmca2006 is on a distinguished road
Reputation: 21
Default Re: AFL required

HTML Code:
tx = Trix(5);
sig = EMA(tx,3);

gc = Cross(tx,sig);
dc = Cross(sig, tx);
bounce = Cross(ROC(tx, 1), 0);
fall = Cross(0, ROC(tx,1));

PlotShapes(IIf(gc==True, shapeSmallUpTriangle, shapeNone), IIf(gc==True, colorBlue, colorDefault), 0, Low, -20);
PlotShapes(IIf(dC==True, shapeSmallDownTriangle, shapeNone), IIf(dC==True, colorRed, colorDefault), 0, High, -20);
PlotShapes(IIf(bounce==True, shapeSmallUpTriangle, shapeNone), IIf(bounce==True, colorSeaGreen, colorDefault), 0, Low, -40);
PlotShapes(IIf(fall==True, shapeSmallDownTriangle, shapeNone), IIf(fall==True, colorOrange, colorDefault), 0, High, -40);
Sir

Requesting to recheck the above AFL of
Code:
bounce=tx:=TRIX(5);
Cross(ROC(tx,1,$),0)
and
Code:
fall=tx:=TRIX(5);
Cross(0,ROC(tx,1,$))
because I am getting different result, moreover have seen GC and fall on same bar .
Effect of $ is also not found in above AFL.
I do not know anything about language/ programming.
Reply With Quote
  #6  
Old 19th November 2008, 04:47 PM
Member
 
Join Date: Oct 2007
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
reenu10 is on a distinguished road
Reputation: 20
Default Re: AFL required

can any body provide AFL for RSI n EMA crosover i mean it should show buy arrow when rsi is abv ema n sell arrow when ema is below rsi.
thanks in advance
Reply With Quote
  #7  
Old 20th November 2008, 03:38 AM
Member
 
Join Date: Sep 2008
Posts: 8
Thanks: 1
Thanked 5 Times in 1 Post
brevco is on a distinguished road
Reputation: 15
Default Re: AFL required

Hello, reenu10:

I am not an expert, but I created this afl.

I put this afl together with the EMA crossing the RSI.

Note: In the parameter window you can adjust the RSI setting and the moving average.

After you put this indicator on your chart, you will have to left-click on your indicator pane and select "Parameters."

There, you can select the settings for your RSI (the default is 15), and then you will need to choose "RSI" in the "Fields" section of the moving average so the moving average will be on the RSI.

You can also select the colors of your moving average as well as the type of moving average.

There are also green arrows for buy and red for sell.

I am sure someone can make this better, but for now I hope this helps.

brevco

SetChartOptions(0,0,chartGrid30|chartGrid70);
periods = Param( "Periods", 15, 1, 200, 1 );

Plot( RSI( periods), "RSI", ParamColor( "RSI Color", colorBlack ), ParamStyle("Style", styleThick) );

Plot(70,"",colorBlack,styleLine|styleNoLabel);//OS
Plot(30,"",colorDarkGrey,styleLine | styleNoLabel);//OB
Plot(50,"",colorYellow,styleDashed|styleNoLabel);//50 line


_SECTION_BEGIN("Weighted MA Color");

SetChartBkColor( ColorHSB( 86, 36, 126 ) );
P = ParamField("Field");
Type = ParamList("Type", "Weighted,Lagless-21,Hull-26,Linear Regression-45,Exponential,Double Exponential,Tripple Exponential,Wilders,Simple");
Periods = Param("Periods", 9, 2, 100 );
Displacement = Param("Displacement", 1, -50, 50 );
m = 0;

if( Type == "Weighted" ) m= WMA( P, Periods );
if( Type == "Lagless-21" ) m= 2*EMA(P, Periods)-EMA(EMA(P, Periods), Periods);
if( Type == "Hull-26" ) m= WMA(2*(WMA(P, Periods/2))-WMA(P, Periods) ,4 );
if( Type == "Linear Regression-45" ) m= LinearReg( P, Periods );
if( Type == "Exponential" ) m = EMA( P, Periods );
if( Type == "Double Exponential" ) m = DEMA( P, Periods );
if( Type == "Tripple Exponential" ) m = TEMA( P, Periods );
if( Type == "Wilders" ) m = Wilders( P, Periods );
if( Type == "Simple" ) m = MA( P, Periods );


Linecolor = IIf( m > Ref( m, -1), ParamColor("UPColor", colorWhite), ParamColor("DOWNColor", colorBlack) );

Plot( m, _DEFAULT_NAME(),Linecolor , styleThick, 0, 0, Displacement );
_SECTION_END();

Buy = RSI ()> m;
Sell = RSI ()< m;


Buy = ExRem(Buy, Sell);
Sell = ExRem(Sell, Buy);


PlotShapes(IIf(Buy,shapeUpArrow,0) ,colorBrightGreen );
PlotShapes(IIf(Sell,shapeDownArrow,0) ,colorRed);

AlertIf(Buy,"SOUND C:\\Windows\\Media\\tada.wav","Long ");
AlertIf(Sell,"sound C:\\Windows\\media\\tada.wav","sell");
Reply With Quote
  #8  
Old 20th November 2008, 06:19 PM
Member
 
Join Date: Oct 2007
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
reenu10 is on a distinguished road
Reputation: 20
Default Re: AFL required

thanks brecov for the efforts you put in ,but it is showing an error it says
variable`m' being used without having being initialized......so kindly look into it.
Regards
Reply With Quote
  #9  
Old 20th November 2008, 07:05 PM
Member
 
Join Date: Oct 2007
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
reenu10 is on a distinguished road
Reputation: 20
Default Re: AFL required

thanks a million..............i solved the problem and its working fine now.
Reply With Quote
  #10  
Old 21st November 2008, 12:34 AM
Member
 
Join Date: Sep 2008
Posts: 8
Thanks: 1
Thanked 5 Times in 1 Post
brevco is on a distinguished road
Reputation: 15
Default Re: AFL required

You are very welcome.

brevco
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 11:36 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