>> H30m = HHV(H,19);
>> EntryLongSignal = Cross(H,H30m);

That is saying you want High to cross the HHV of High, which is
impossible. High can never be higher than its HHV value, which means
there will never be a cross.

Also, for efficiency purposes, you could do all the array maths before
entering the loop.

Regards,
GP


--- In [email protected], asit mistry <[EMAIL PROTECTED]> wrote:
>
> 
> helow fellow traders,
>  
> i am trying to writ AFL code for intraday brekout sysem. i have
written following code which does note return any trade in backtesting
mode. what is wron with programming.
>  
> my system :
>  
> check for HHV/LLV up to first 17 bars(intraday 5 min bars). buy 1
tick above hhv value from 18 th bar to end of day. exit at end of day
close. explosartion with filter unmarked ok.
>  
> asit.
>  
>  
> TimeFrameSet(in5Minute);
> Date_Value = DateNum() ;
> Time_Value = TimeNum() ;
> ps = 0 ;
> Buy = 0;
> Sell = 0;
> Stop = Null;
> StopArray = Null;
> ExitLongPosition = time_value > 152500 ;
> for( i = 1 ; i < BarCount ; i++ )
> {
> Date_Value = DateNum() ;
> ddh = TimeFrameGetPrice( "H", inDaily );
> ddl = TimeFrameGetPrice( "l", inDaily );
> H30m = 0 ;
> L30m = 0 ;
> if(Date_value[i] = Date_value[i-1] )
> { 
> H30m = HHV(H,19);
> L30m = LLV(L,19);
> EntryLongSignal = Cross(H,H30m);
> }
> if(EntryLongSignal[i])
> { 
> Buy[i] = 1 ;
> BuyPrice[i] = (H30m + 1 ) ;
> for (j = i; j < BarCount; j++) 
> {if (j > i)
> Buy[j] = 0; 
> Sell[i] = exitlongposition[i];
> SellPrice[i] = C[i] ;
> }
> } 
> /* for( j = 0 ; j < BarCount ; j++ )
> { 
> Buy[j] = H[j] > (H30m[j]+1) AND time_value[j] > 113000 ;
> BuyPrice[j] = (H30m[j]+1);
> Sell[j] = time_value[j]> 152500 ;
> SellPrice[j] = C[j] ;
> }*/
> 
> } 
> 
> //Filter = time_value > 112500 AND time_value < 113000 ;
> AddColumn(Date_value,"datevalue",1);
> AddColumn(time_value,"timevalue",1);
> AddColumn(H30m,"highest high",1.2);
> AddColumn(L30m,"lowest low",1.2);
> AddColumn(ddh,"day's high",1.2);
> AddColumn(ddl,"day's low",1.2);
> //AddColumn(tr30m,"atr(30)",1.4);
>  
>  
>  
> _________________________________________________________________
> Post free property ads on Yello Classifieds now! www.yello.in
> http://ss1.richmedia.in/recurl.asp?pid=221
>


Reply via email to