Click or drag to resize

How to develop a Market Scanner

The ScannerBase ScriptType lets the user to add custom columns in the Market Scanner View.

Properties

DisplayValue

The Market Scanner View's cells are bounded to the DisplayValue property. Any computed value has to be assigned to the DisplayValue property in order to be displayed in the column cells.

Methods

OnStateChange

The OnStateChanged method is called whenever the State of the script is changed. The various states which a Scanner class have are:

  • Initialize - when a new column is created or an instrument is added.
  • Finalize - When the script encounters an error or is being finalized (disposed off). All clear up codes should be placed here.
protected override void OnStateChange()
 {
     //your code here
 }

AddInstrument(String)

The Market Scanner user code supports seconday instruments and it can be added by simply calling the AddInstrument method when the Scanner's State is in Initialize state.

protected override void OnStateChange()
 {
     if (this.State == State.Initialize)
     {
         AddInstrument("RELIANCE NSE"); //add a seconday script

         //do other stuff
     }
 }
Virtual methods

OnLevel1(Int32, RealTimeDataEventArgs)

The OnLevel1 method is called upon each incoming RealTimeDataEventArgs data when a Level1 stream is opened. The same can be opened by setting the IsLevel1Subscribed property to true when the Scanner's State is in Initialize state.

protected override void OnLevel1(int idx, RealTimeDataEventArgs e)
{
    //your code here
}

OnPosition(PositionEventArgs)

The OnPosition method is called when the position gets updated.

protected override void OnPosition(PositionEventArgs e)
{
    //your code here
}
Xaml
See Also

Reference