Stock Portfolio Organizer

The ultimate porfolio management solution.

Shares, Margin, CFD's, Futures and Forex
EOD and Realtime
Dividends and Trust Distributions
And Much More ....
For Portfolio Manager Click Here

WiseTrader Toolbox

#1 Selling Amibroker Plugin featuring:

Advanced Adaptive Indicators
Advanced Pattern Exploration
Neural Networks
And Much More ....
Find Out More Here

Intraday Trading System based on Ehlers Cycle and Trend Filter Theory for Amibroker (AFL)

Rating:
3 / 5 (Votes 3)
Tags:
intraday, ehler, trading system, amibroker

Based on Ehler’s “Cycle n Trend Filter Theory”, I hve made an IntraDay Trading System AFL Primarily for NIFTY & BANKNIFTY (5 Mnt TF):

1. It works on MCX Market too, But u need to change the Entry & Exit Time settings.
2. Works better in 5 Mnt TF.
3. The heart of the AFL is not mine in Entirety, I hve Tuned n Tweaked n Added n Modded to make it an IntraDay Trading System.
4. Plz Note that it Does Not Plot Price, So its a good idea to plot a “Basic Price afl” in a Lower Pane to have a Clear Perspective.—> will upload Image tomorrow during live Market.
5. My Historical DataBase is limited and the BackTest Results on my limited DB is very Heartening (NIFTY & BANKNIFTY), and so plz BackTest it Extensively on a Larger DB and gimme FeedBack and I will add features like TSL etc based on your FeedBack.

Indicator / Formula

Copy & Paste Friendly
_SECTION_BEGIN("PrctclModeDComp---TF=5Mnt");

TN=TimeNum();
EntryTime=TN>=103001 && TN<=150000;
ExitTime=TN>=151900;
PI = 3.1415926;

SetBarsRequired( sbrAll,0 );   
function MulTwinLevel( Feed, N, c0, c1, b0, b1, b2, a1, a2 )  
{  
   Extract = Feed; // initialize for N first bars  
 
  for( i = Max( N, 2 ); i < BarCount; i++ )  
  {  
     Extract[ i ] =   c0[ i ] * ( b0 * Feed[ i ] +  
                                 b1 * Feed[ i - 1 ] +  
                                 b2 * Feed[ i - 2 ] ) +  
                     a1 * Extract[ i - 1 ] +  
                     a2 * Extract[ i - 2 ] -  
                     c1 * Feed[ i - N ];  
  }  
 
  return Extract;  
}  
 
function ExtractFilter( Feed, Period, delta )  
{  
   N = 0;  
   an = 2 * PI / Period;  
 
   c0 = b0 = 1;  
   c1 = b1 = b2 = a1 = a2 = gamma1 = 0;  
    
   beta1 = cos( 2 * PI / Period );  
   gamma1 = 1 / cos( 4 * PI * delta / Period );  
   alpha = gamma1 - sqrt( gamma1 ^ 2 - 1 );  
   a1 = beta1 * ( 1 + alpha );  
   a2 = - alpha;  
      
   c0 = ( 1 - alpha ) / 2;  
   b2 = -1;  
 
   return MulTwinLevel( Feed, N, c0, c1, b0, b1, b2, a1, a2 );  
}  
 
Period =Optimize("Period", 10, 10, 900, 10 );  
Delta =Optimize("Delta", 0.15, 0.05, 1, 0.05 );  
 
Cycle = ExtractFilter( (H+L)/2, Period, Delta );  
Trend = MA( Cycle, 2 * Period );
CycleMean=(HHV(Cycle,300)+LLV(Cycle,300))/2;  
 
Plot( CycleMean, "CycleMean", colorRed ); 
Plot( Trend, "Trend", colorBlue );

Buy1=Trend>CycleMean && C>WMA(C,Period) && StochD(14)<23;
Short1=Trend<-CycleMean && C<WMA(C,Period) && StochD(14)>77;

Buy=Ref(Buy1,-1) && EntryTime;
Short=Ref(Short1,-1) && EntryTime;

Sell=Short1 OR ExitTime ;
Cover=Buy1 OR ExitTime;

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

BuyPrice=O;
ShortPrice=O;
SellPrice=C;
CoverPrice=C;

PlotShapes(IIf(Buy,shapeUpArrow,shapeNone),colorGreen,0,BuyPrice);
PlotShapes(IIf(Sell,shapedownArrow,shapeNone),colorRed,0,sellPrice);
PlotShapes(IIf(Short,shapedownArrow,shapeNone),colorYellow,0,shortPrice);
PlotShapes(IIf(Cover,shapeUpArrow,shapeNone),colorTurquoise,0,coverPrice);

_SECTION_END();

Title = EncodeColor(colorPink)+  Name() + " - " + EncodeColor(colorRed)+ Interval(2) + EncodeColor(colorWhite) +
 "  - " + Date() +" - "+"\n" +EncodeColor(colorYellow) +"Op-"+O+"  "+"Hi-"+H+"  "+"Lo-"+L+"  "+
"Cl-"+C+"  "+ "Vol= "+ WriteVal(V)+"\n";

1 comments

1. Timon

buy sell arrows not displaying

Leave Comment

Please login here to leave a comment.

Back