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

Re: [amibroker] Alert and triggers help



PureBytes Links

Trading Reference Links

Hi Tony,

You can run this from within the AA and set the parameters from there.


NUMBER_OF_SYMBOLS = Param( "Number of Symbols: ", 5, 1, 10, 1 );

for ( i = 1; i < NUMBER_OF_SYMBOLS + 1; i++ ) {

        StaticVarSetText( "Symbol" + i, ParamStr( "Symbol " + NumToStr(i, 1.0) , "" ) ) ;
        VarSet( "LT" + i, Param( "Symbol " + NumToStr(i, 1.0) + " (Long):" , 0, 0, 500, 0.01 ) );
        VarSet( "ST" + i, Param( "Symbol " + NumToStr(i, 1.0) + " (Short):" , 0, 0, 500, 0.01 ) );

        if ( VarGet( "LT" + i ) > 0 ) {
        LongCondition = Cross( VarGet( "LT" + i ) , C ) AND Name() == StaticVarGetText( "Symbol" + i );
        AlertIf( LongCondition, "", "Long Signal", 1, 1 );
        }

        if ( VarGet( "ST" + i ) > 0 ) {
        ShortCondition = Cross( VarGet( "ST" + i ) , C ) AND Name() == StaticVarGetText( "Symbol" + i );
        AlertIf( ShortCondition, "", "Short Signal", 3, 1 );
        }

}

Filter = 1;
AddColumn( C, "Close" );




Regards,
William Peters
http://www.amitools.com




Saturday, November 26, 2005, 9:31:22 AM, you wrote:
TL>  Hi,

TL>  I have the following stock picks with triggers and would
TL> like to make a simple code that will alert me of these stocks.  

TL>  ACI LONG 70.51 SHORT 69.23
TL>  HOV LONG 48.70 SHORT 47.83

TL>  Currently, I'm using the following code.  My question is
TL> there a better and more efficient way of doing this.  The reason
TL> is because I have about 5 stocks per week with both long and short
TL> triggers.  I was wondering if I can do something in AA where I can
TL> go to parameters and set the required parameters that will allow
TL> me to enter both the stock and their triggers without going back
TL> to "edit AFL."

TL>  AlertIf( Cross(69.23,C) AND Name()=="ACI", "", "Short", 3 );
TL>  AlertIf( Cross(C, 70.51) AND Name()=="ACI", "", "Long", 3 );


TL>  thanks

TL>  tony




------------------------ Yahoo! Groups Sponsor --------------------~--> 
Try Online Currency Trading with GFT. Free 50K Demo. Trade 
24 Hours. Commission-Free. 
http://us.click.yahoo.com/RvFikB/9M2KAA/U1CZAA/GHeqlB/TM
--------------------------------------------------------------------~-> 

Please note that this group is for discussion between users only.

To get support from AmiBroker please send an e-mail directly to 
SUPPORT {at} amibroker.com

For other support material please check also:
http://www.amibroker.com/support.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/