Matthew Greenslet
 Idol
    Posts: 2077
Joined: 2/27/2006
User Profile |
Q: I have filter my focus list but Omni Pilot trades on all the signals and not just the filtered ones. How can I use these filters?
A:
We will need to add some code to our Common.txt file. Highlight common.txt to view the code. The first subroutine you see is Trade_Focus list, the second is Do_Trade. The Do_Trade routine is where we will insert our code.
If you select Symbol Object from the drop down menu to the right you will see all the properties of a symbol object which you can check. You will see several options which allow you to reference the focus list statistics. Here is an example code snippet that will filter out signals when the Advisor Rating is below 70, or the BTHR(Back Test Hit Rate) is below 60, or the BTNT(Back Test Number of Trades) is below 3. You can add more/less critera as you see fit. Please note that these fields must be in the focus list for this to work. You can add the fields by clicking on the wrench icon at that top of the focus list. The code in bold is what needs to be added.
Public Sub Do_Trade(ByVal oSymbol As SymbolObject, ByVal nSignal As Integer, ByVal sTimeFrame As String, _
ByVal sTradePlan As String, _
ByVal bMinAllocation As Boolean, ByVal fMinAllocation As Single, _
ByVal fMaxAllocation As Single, _
ByVal bMinSharesToTrade As Boolean, ByVal fMinSharesToTrade As Single, _
ByVal bMaxSharesToTrade As Boolean, ByVal fMaxSharesToTrade As Single, _
ByVal bRoundLot As Boolean, ByVal nRoundLot As Integer, _
ByVal sEMailAddress As String, ByVal bEmail As Boolean, ByVal bReverse As Boolean, ByVal bExit As Boolean)
If oSymbol.Adv < 70 _
Or oSymbol.BTHR < 60 _
Or oSymbol.BTNT < 3 Then
LogAction("Symbol did not pass the filter critera.", _
enuLogImportance.enuVerbose) ' Log why signal is being ignored
Exit Sub ' Do not trade
End If
LogAction("Do_Trade: Processing '" & GetSignalName(nSignal) & "' signal on symbol " _
& oSymbol.Symbol, enuLogImportance.enuVerbose) ' Output log
|