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

[amibroker] Re: Price Steps



PureBytes Links

Trading Reference Links

Hi,

I know what I want to do but AFL is so extensive that I just don't
know where to start!

I have a list of stocks I want to monitor at certain end of day prices.

At the moment I have found the alertif to tell me when the price of a
stock reaches an interesting level, when I then have to manually check
a lot of other calculations.

For example, So I've got the following code.

-----------------------
Buy=False;
Sell=False;
AlertIf(Name()=="AA"  AND(L<30.56*1.02),"",NumToStr(L)+" Buy 
30.56",1,1+2);
AlertIf(Name()=="GM"  AND(H>47.30*0.98),"",NumToStr(H)+" Sell
47.3",1,1+2);
-----------------------

I'm trying to monitor about 140 stocks in a spreadsheet and have to
manually transfer the numbers into the program. I would like to
simplify the procedure! First step is how to put to process the array
so ...

how do I turn the above into a procedure like the following

-----------------------
CheckArray[1,1]="AA";
CheckArray[1,2]="Buy";
CheckArray[1,3]=30.56;

CheckArray[2,1]="GM";
CheckArray[2,2]="Sell";
CheckArray[2,3]=47.3;

	for stocks = 1 to 2
	IsInteresting( CheckArray[stocks, 1],CheckArray[stocks,
2],CheckArray[stocks, 3] )
	next

function IsInteresting( Stock, BuySell, Price);

	If BuySell = "Buy"
		If L < Price*1.02
		Write( Stock + "Buy at" + Price + " - Currently at " + C )
		endif
	else
		If H > Price*0.98
		Write( Stock + "Sell at" + Price + " - Currently at " + C )
		endif
	endif
end
-----------------------
Next step is how to import an Excel / ascii CSV file into an array.
Ideas for that would also be appreciated.

I'm not even sure if I've got it in the right place as it looks like
you can also write code in the commentary as I found from my last
question!

I'm sure it's simple but I just get a headache trying to figure out
where to start!

Many thanks
--
Alan



------------------------ Yahoo! Groups Sponsor --------------------~--> 
Yahoo! Domains - Claim yours for only $14.70
http://us.click.yahoo.com/Z1wmxD/DREIAA/yQLSAA/GHeqlB/TM
--------------------------------------------------------------------~-> 

Check AmiBroker web page at:
http://www.amibroker.com/

Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/amibroker/

<*> To unsubscribe from this group, send an email to:
    amibroker-unsubscribe@xxxxxxxxxxxxxxx

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