• Home
  • Products
    • Login
    • Product Info
    • User Guide
    • Pricing
  • Services
    • Stock Brokers
    • Freelancers
  • Help
    • Documentation
    • Knowledge Base
    • FAQ
  • Company
    • About Us
    • Contact Us
    • Terms & Conditions
  • Home
  • Products
    • Login
    • Product Info
    • User Guide
    • Pricing
  • Services
    • Stock Brokers
    • Freelancers
  • Help
    • Documentation
    • Knowledge Base
    • FAQ
  • Company
    • About Us
    • Contact Us
    • Terms & Conditions
home/Knowledge Base/AmiBroker

AmiBroker scanner fires orders only for first symbol

781 views February 7, 2024 stkadmin 1

When you run strategies in Amibroker scanner for multiple symbols, the orders are being fired only for the first symbol.

Solution

AutoTrader afl functions provided in (algotrader-util.afl) use chart level parameters. So same parameters are used for all symbols. But in case of scanner, you need a different parameter per symbol. In simple words, the symbol passed to placeOrder*() function must be different for each stock. No matter which placeOrder*() function you use, always pass a symbol using Name() function as shown below:

See (at-ema-crossover-scanner.afl) in AutoTrader samples (C:\autotrader\scripts\amibroker\Formulas\AutoTrader).

placeOrder(AT_EXCHANGE , AT_INSTRUMENT, AT_SYMBOL , “BUY”, AT_PRODUCT_TYPE , AT_ORDER_TYPE, 10, 0, 0, AT_OPTION_TYPE, AT_STRIKE_PRICE , AT_EXPIRY );

So change AT_SYMBOL to Name() function in your Amibroker afl.

placeOrder(AT_EXCHANGE , AT_INSTRUMENT, Name(), “BUY”, AT_PRODUCT_TYPE , AT_ORDER_TYPE, 10, 0, 0, AT_OPTION_TYPE, AT_STRIKE_PRICE , AT_EXPIRY );


Please refer to this link:
http://www.amibroker.com/kb/2014/10/29/using-per-symbol-parameter-values-in-charts/

Tags:AmiBroker

Was this helpful?

1 Yes  No
Related Articles
  • AmiBroker does not save timeseries data
  • Amibroker multiple charts OR execution when AmiBroker is minimized?
  • Realtime & Backfill data does not show up in chart
  • Amibroker keeps on refreshing/flickering
  • AmiBroker database error (Directory must be empty)
  • The formula requires AmiBroker version x.x or higher
AmiBroker
  • AmiBroker scanner fires orders only for first symbol
  • AmiBroker does not save timeseries data
  • Amibroker multiple charts OR execution when AmiBroker is minimized?
  • Realtime & Backfill data does not show up in chart
  • Amibroker keeps on refreshing/flickering
  • AmiBroker database error (Directory must be empty)
View All 7  
Popular Articles
  • Upstox: Something went wrong
  • User Blocked Contact System Administrator
  • AB1007: Your user id or password is invalid
  • Kite: Incorrect `api_key` or `access_token`
  • Login failed: Invalid username or password
KB Categories
  • AmiBroker
  • AutoTrader Web

© 2025 Stocks Developer. All Rights Reserved.