• C#
  • Java
  • VB
  • C++
  • Python
Contact us
Scanner Parameters

A list of TWS scanner parameters can be obtained via IBApi.EClient.reqScannerParameters. Not all of the returned parameters to scannerParameters are available from the API scanners.

  • client.reqScannerParameters();
  • client.reqScannerParameters();
  • client.reqScannerParameters()
  • m_pClient->reqScannerParameters();
  • 1  self.reqScannerParameters()

A string containing all available XML-formatted parameters will then be returned via IBApi.EWrapper.scannerParameters

  • public class EWrapperImpl : EWrapper
    {
    ...
    public virtual void scannerParameters(string xml)
    {
    Console.WriteLine("ScannerParameters. "+xml+"\n");
    }
  • public class EWrapperImpl implements EWrapper {
    ...
    @Override
    public void scannerParameters(String xml) {
    System.out.println("ScannerParameters. " + xml + "\n");
    }
  • Public Class EWrapperImpl
    Implements EWrapper
    ...
    Public Sub scannerParameters(xml As String) Implements IBApi.EWrapper.scannerParameters
    Console.WriteLine("ScannerParameters. " & xml & "\n")
    End Sub
  • class TestCppClient : public EWrapper
    {
    ...
    void TestCppClient::scannerParameters(const std::string& xml) {
    printf( "ScannerParameters. %s\n", xml.c_str());
    }
  • 1 class TestWrapper(wrapper.EWrapper):
    ...
    1  def scannerParameters(self, xml: str):
    2  super().scannerParameters(xml)
    3  open('log/scanner.xml', 'w').write(xml)
    4  print("ScannerParameters received.")

Important: remember the TWS API is just an interface to the TWS. If you are having problems defining a scanner, always make sure you can create a similar scanner using the TWS' Advanced Market Scanner.