[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[amibroker] afl help needed - 3 line break



PureBytes Links

Trading Reference Links

Can anyone tell me what is wrong with the code ?

3 line break system
----------------------
BP  = Low;
Cur = High;
Dir  = 0;
C1  = 0;
C2  = 0;
C3  = 0;

for( i = 1; i < BarCount; i++ )
{
	if ( i == 1 )
	{
		BP[1]  = Close[0];
		Cur[1] = Close[1];									
		C1[1]  = Close[0];
		C2[1]  = Close[0];
		C3[1]  = Close[0];
	
		If ( Close[1] > Close[0] )
		{		
			Dir[1] = 1;
		}
		else
		{
			Dir[1] = -1;
		}									
	}
	else
	{
		if ( Dir[i] = 1 )
		{
			if ( Close[i] > Cur[i] )
			{	Cur[i] = Close[i];
				BP[i]  = C3[i];										BP[i]  = C3[i];
				C3[i]  = C2[i];
				C2[i]  = C1[i];
				C1[i]  = Close[i]; 
			}
			else
			{
				if ( Close[i] < BP[i] )
				{
				Cur[i] = Close[i];
				Dir[i] = -1;
				BP[i] = C1[i];										Dir[i] = -1;										BP[i]  = C1[i];
				C1[i]  = Close[i];
				C3[i]  = Cur[i-1];
				}
			}
		}

		if ( Dir[i] = -1 )
		{
			if ( Close[i] < Cur[i] )
			{
			Cur[i] = Close[i];
			BP[i]  = C3[i];										BP[i]  = C3[i];
			C3[i]  = C2[i];
			C2[i]  = C1[i];
			C1[i]  = Close[i];
			}
			else
			{
				if ( Close[i] > BP[i] ) 
				{
				Cur[i] = Close[i];
				Dir[i] = 1;										Dir[i] = 1;											BP[i]  = C1[i];
				C1[i]  = Close[i];
				C3[i]  = Cur[i-1];
				}
			}
		}			
}

Buy = Cross( Close, BP );
Short = Cross( BP, Close );
Sell = Short;
Cover = Buy;
----------------------




------------------------ Yahoo! Groups Sponsor ---------------------~-->
Buy Ink Cartridges or Refill Kits for Your HP, Epson, Canon or Lexmark
Printer at Myinks.com. Free s/h on orders $50 or more to the US & Canada. http://www.c1tracking.com/l.asp?cid=5511
http://us.click.yahoo.com/l.m7sD/LIdGAA/qnsNAA/GHeqlB/TM
---------------------------------------------------------------------~->

Send BUG REPORTS to bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx 
(Web page: http://groups.yahoo.com/group/amiquote/messages/)
--------------------------------------------
Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/