2010年4月14日 星期三

Shark System V1 pt3

Support 1. period for super sell 40 2. indicators support KD, RSI, MV, OBV 3. Fast Length, Slow Length K(9), D(9) RSIF(9), RSIS(24) MV(9), MV(24) OBV(9),OBV(24) PS: using MV average line to plot upper and lower band, that can be define our entry point and leave point. 4. Result : OBV*0.3 + MV*0.3 + KD*0.2 + RSI*0.2 sample code 4 KD entry( perl ) , it would get the inf from our "indicator generator 4 Excel", indicator Ref : http://funningboy.blogspot.com/2010/03/auto-indicator-4-excel.html
 sub GetKDEntryRst{
 my ($MyCurK,$MyCurD);
 my ($MyPreK,$MyPreD);
 my ($MyPosK,$MyPosD) =(0,0);
 my ($MyNegK,$MyNegD) =(0,0);
 my $MyKDRst =0;
    
    
  for(my $i= $MyPeriod-2; $i<=$MyPeriod; $i++){  
    $MyPreK = $sheet->Cells($i-1,'L')->{Value}; 
    $MyPreD = $sheet->Cells($i-1,'M')->{Value}; 
 
    $MyCurK = $sheet->Cells($i,'L')->{Value}; 
    $MyCurD = $sheet->Cells($i,'M')->{Value};
    
    #Trend
    # constrain K,D<=35;
    if( $MyCurK<=35 && $MyCurD<=35 ){
     if($MyPreK<=$MyCurK){ $MyPosK++; }
     else{                 $MyNegK++; }
     
     if($MyPreD<=$MyCurD){ $MyPosD++; }
     else{                 $MyNegD++; }
     }
   }
   
    if(($MyPosK+$MyPosD) > ($MyNegK+$MyNegD)){ $MyKDRst=1; }
      
    #print "$MyPosK,$MyPosD,$MyNegK,$MyNegD\n";
    
    return $MyKDRst;
 }

沒有留言:

張貼留言