Stock Portfolio Organizer
The ultimate porfolio management solution.
Shares, Margin, CFD's, Futures and Forex
EOD and Realtime
Dividends and Trust Distributions
And Much More ....
WiseTrader Toolbox
#1 Selling Amibroker Plugin featuring:
Advanced Adaptive Indicators
Advanced Pattern Exploration
Neural Networks
And Much More ....
nest auto buy sell afl for Amibroker (AFL)
Copy & Paste Friendly
Back
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 | ClientID = ParamStr ( "ClientId" , "000000" ); Symbol= ParamStr ( "Symbol" , "NIFTY13DECFUT" ); Price= NumToStr ( C ,8.3, True ); Quantity= Param ( "Quantity" ,1,1,100,1); OE = ParamList ( "Order Execution" , "Immediate,On Candle Completion" ,1); AT = ParamToggle ( "AutoTrade" , "No,Yes" ); if (OE== "On Candle Completion" ) { Buy = Ref ( Buy ,-1); Short = Ref ( Short ,-1); Sell = Ref ( Sell ,-1); Cover = Ref ( Cover ,-1); } AplliedQuantity= IIf ( LastValue ( Buy ) AND LastValue ( Cover ) OR LastValue ( Short ) AND LastValue ( Sell ),Quantity*1,Quantity); RefNumber = Nz ( StaticVarGet ( "RefNumber" )); Checkdt= Nz ( StaticVarGet ( "lastdt" )); dt = LastValue ( DateTime () ); Cond= LastValue ( Buy ) OR LastValue ( Short ) OR LastValue ( Sell ) OR LastValue ( Cover ); if (AT) { plus = CreateStaticObject ( "Nest.PlusApi" ); if (plus) { plus.SetObjectName(ClientID); if (Cond AND Checkdt != dt ) { if ( LastValue ( Buy ) OR LastValue ( Cover )){plus.PlaceOrder( "BUY" ,RefNumber, "NFO" ,Symbol, "DAY" , "LIMIT" ,AplliedQuantity,Price,0,1, "MIS" ,ClientID);} if ( LastValue ( Short ) OR LastValue ( Sell )){plus.PlaceOrder( "SELL" ,RefNumber, "NFO" ,Symbol, "DAY" , "LIMIT" ,AplliedQuantity,Price,0,1, "MIS" ,ClientID);} StaticVarSet ( "RefNumber" ,RefNumber+1); StaticVarSet ( "lastdt" ,dt ); } } } |