My Amibroker AFL ( Mahadev )

Discussion in 'Advanced Trading Strategies' started by yrjadeja, Aug 23, 2012.

  1. yrjadeja

    yrjadeja Member

    Joined:
    Sep 12, 2010
    Messages:
    52
    Likes Received:
    2
    Trophy Points:
    8
    HI


    ( remove spaces in below link )

    h t t p://www.mudraa. com/trading/135639/0/my-amibroker-afl. html

    i have posted AFL on Mudraa go to above link

    thanks

    better to take RSI or MACD for confirmation of signals
     
    Last edited: Aug 23, 2012
  2. yrjadeja

    yrjadeja Member

    Joined:
    Sep 12, 2010
    Messages:
    52
    Likes Received:
    2
    Trophy Points:
    8
  3. rh6996

    rh6996 Well-Known Member

    Joined:
    Sep 22, 2007
    Messages:
    2,817
    Likes Received:
    1,574
    Trophy Points:
    113
    Location:
    Jaipur
    Why not post a current chart of any stock or Nifty with this AFL.

    Here is the AFL I copied from Mudraa

    SECTION_BEGIN("Mahadev");
    SetChartOptions(0,chartShowArrows|chartShowDates);
    _N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ));
    Plot( C, "Close", ParamColor("Color", colorBlack ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() );


    A = Wilders( H,34 );
    B = Wilders( L,34 );


    x= Ref(A,-34);
    y= Ref(B,-34);

    D=.0009;
    xt=x+x*D;
    xb=x-x*D;

    yt=y+y*D;
    yb=y-y*D;

    /* Buy or Sell Condition */
    Buy = Cross(Close,xt);
    Sell = Cross(yt,Close);
    Buy = ExRem(Buy,Sell);
    Sell = ExRem(Sell,Buy);

    AlertIf( Buy, "SOUND C:\\Windows\\Media\\notify.wav", "Audio alert", 2);
    AlertIf( Sell, "SOUND C:\\Windows\\Media\\tada.wav", "Audio alert", 2 );

    Filter = Buy OR Sell;
    /* Exploration Parameters */
    AddTextColumn( FullName(), "Company Name" );
    AddColumn( Buy, "Buy", 1 );
    AddColumn( Sell, "Sell", 1 );
    AddColumn( C, "Close", 1.3 );
    AddColumn( H, "High", 1.3 );

    Title = EncodeColor(colorWhite)+ "Mahadev" + " - " + Name() + " - " + EncodeColor(colorRed)+ Interval(2) + EncodeColor(colorWhite) +
    " - " + Date() +" - "+"\n" +EncodeColor(colorRed) +"Op-"+O+" "+"Hi-"+H+" "+"Lo-"+L+" "+
    "Cl-"+C+" "+ "Vol= "+ WriteVal(V)+"\n"+
    EncodeColor(colorLime)+
    WriteIf (Buy , " GO LONG / Reverse Signal at "+C+" ","")+
    WriteIf (Sell , " EXIT LONG / Reverse Signal at "+C+" ","")+"\n"+EncodeColor(colorWhite)+
    WriteIf(Sell , "Total Profit/Loss for the Last Trade Rs."+(C-BuyPrice)+"","")+
    WriteIf(Buy , "Total Profit/Loss for the Last trade Rs."+(SellPrice-C)+"","");

    PlotShapes(IIf(Buy, shapeSquare, shapeNone),colorGreen, 0, L, Offset=-40);
    PlotShapes(IIf(Buy, shapeSquare, shapeNone),colorLime, 0,L, Offset=-50);
    PlotShapes(IIf(Buy, shapeUpArrow, shapeNone),colorWhite, 0,L, Offset=-45);
    PlotShapes(IIf(Sell, shapeSquare, shapeNone),colorRed, 0, H, Offset=40);
    PlotShapes(IIf(Sell, shapeSquare, shapeNone),colorOrange, 0,H, Offset=50);
    PlotShapes(IIf(Sell, shapeDownArrow, shapeNone),colorWhite, 0,H, Offset=-45);
    _SECTION_END();



    Works good in 5 mint for equity market & for commodity use 15mint chart.

    Friends please give ur valuable suggetion/view about this afl.

    ***************************************************

    It is suggested to use it in 7 minutes TF! However more ppl would prefer a 5 minute TF as that is the most popular Data available easily!
     
  4. yrjadeja

    yrjadeja Member

    Joined:
    Sep 12, 2010
    Messages:
    52
    Likes Received:
    2
    Trophy Points:
    8
    screen shot of last 4 days
     
    Last edited: Sep 10, 2012
  5. a1b1trader

    a1b1trader Well-Known Member

    Joined:
    Aug 3, 2012
    Messages:
    2,423
    Likes Received:
    3,105
    Trophy Points:
    113
    Showing error in ami 5.5
    Please check
     
  6. yrjadeja

    yrjadeja Member

    Joined:
    Sep 12, 2010
    Messages:
    52
    Likes Received:
    2
    Trophy Points:
    8
    ( give screen shot of ur error will try to solve it )
     

  7. johnnypareek

    johnnypareek Well-Known Member

    Joined:
    Jun 14, 2006
    Messages:
    875
    Likes Received:
    595
    Trophy Points:
    93
    at very first line put a "_" . which will looks like this _section_begin.

    johnny
     
    a1b1trader likes this.
  8. a1b1trader

    a1b1trader Well-Known Member

    Joined:
    Aug 3, 2012
    Messages:
    2,423
    Likes Received:
    3,105
    Trophy Points:
    113
    Thanks Johny Bhai for your help.

    A request Bro, can you please tell/explain a simple method to correct such minor mistakes in AFL, as I have a few AFLs that are not working and showing errors and I want to correct those AFLs.

    Although it is mentioned, mostly, in the error
    Use 'Edit Formula' to correct error
    But I couldnt be able to locate this 'Edit Formula" sheet in amibroker.
    So please help me out.
    Thanks
     
  9. yrjadeja

    yrjadeja Member

    Joined:
    Sep 12, 2010
    Messages:
    52
    Likes Received:
    2
    Trophy Points:
    8
    give me ur mail id i will mail u afl. and direction where to put it if u know where to put then no worry
     
  10. kirthi1987

    kirthi1987 Member

    Joined:
    May 9, 2009
    Messages:
    107
    Likes Received:
    22
    Trophy Points:
    18
    which timetrame ru using sirji
     
Loading...

Share This Page