PDA

View Full Version : STOP/LIMIT orders



Finsys Technical
06-15-2015, 01:50 PM
Dear

Kindly guide me how to implement Stop/Limit order using LP API. Right now my bridge only execute market order but I want to execute LIMIT/STOP orders on FIX server as well and when price hits I get the execution at Vertex Client.

Regards
Finsys Technical

Hassan-HS
06-15-2015, 05:05 PM
Dear Finsys,

At first you have to implement NewLimitOrder (http://www.hybrid-solutions.com/support/index.php?/Knowledgebase/Article/View/2057) method on LP class.

secondly, you have to set some configuration on RMP rules to cover the orders as limit orders on the LP side.

1-At first please make sure the BO & LP is connected.
376
2- Please Map symbol between Vertexfx BO System & LP System, check this link (http://www.hybrid-solutions.com/support/index.php?/Knowledgebase/Article/View/2167)for more info

3- Tick the check box beside the desired symbol name on RMP Rules tab, then right click and edit, or tick the check box on the top of this window to select all symbols and click edit to change the setting for the whole symbols. Then a new window will appear as the following image
RMP:
377

378
Then you can select the covered order type (market order, limit order) from How to cover options.
379

for more info please visit this link (http://www.hybrid-solutions.com/support/index.php?/Knowledgebase/Article/View/2168).

then take an order from a account already under the dealer who already logged in and it will be covered as limit order on the LP side.


Note:
The bridge place limit orders only (no stop order) on the LP side (it's business issue), but you can open stop order (http://www.hybrid-solutions.com/support/index.php?/Knowledgebase/Article/View/3876) manually by VBL language, for more info about VBL please visit this link (http://www.hybrid-solutions.com/support/index.php?/Knowledgebase/Article/View/3757).


Please clarify the second inquiry


and when price hits I get the execution at Vertex Client.

Finsys Technical
06-17-2015, 02:34 PM
Hi

We wanted to put STOP/LIMIT at LP side which is over FIX and its should appear at LP software as STOP/LIMIT order and once price matches we get order filled at Vertex Client .

Regards
Irfan

Hassan-HS
06-17-2015, 02:56 PM
Hello,

If you are familiar with programming :
You can do this easily using VBL language, first you have to monitor Transactionlog (http://www.hybrid-solutions.com/support/index.php?/Knowledgebase/Article/View/4692)event, and you can place any order on LP side whenever your condition is satisfied using this method (http://www.hybrid-solutions.com/support/index.php?/Knowledgebase/Article/View/3800)

If not please let me know to assist you in coding your idea

Hassan-HS
06-19-2015, 04:34 PM
Hi,

Sorry, I dont understand what you want at all.

Do you want to reflect the stop/limit orders on LP side before it get executed?

Hassan-HS
06-23-2015, 11:47 AM
Dear Finsys,

At First, did you override this method (http://www.hybrid-solutions.com/support/index.php?/Knowledgebase/Article/View/2057) in class LP in your fix DLL.

Hassan-HS
06-24-2015, 07:32 AM
Great, that means you Dll place limit order on LP side when you set the RMP rules to cover the BO orders as limit orders. right?

Rawan-HS
06-25-2015, 11:16 AM
Dear Finsys

This code is to put the limit/stop order in LP side try it and let me know if you need any things .




Public Sub main()

End Sub


Public Sub TransactionLog(ByVal ClientID As String, ByVal AccountID As String , ByVal TicketOrder As String , ByVal Trans As Short ,ByVal TransType As Short, ByVal TransSubType As Short ,ByVal IP As String, ByVal Amount As Double, ByVal WhoType As Short , ByVal WhoID As Integer, ByVal Method As String, ByVal Commission As Double , ByVal Interest As Double , ByVal Price As Double,ByVal ClosePrice As Double, ByVal SymbolID As Integer, ByVal BuySell As VertexFXBridgeAPI.OperationTypeEnum, ByVal TicketOrder2 As String, ByVal TransTime As String, ByVal TransID As Integer, ByVal RefSymbolPrice As Double, ByVal ProfitLoss As Double)
try
If Trans = 1 then
If TransType = 5 then
Dim symbName as String = LP.SymbolMapped(LP.GetLPs.Item(1).LP.Description,B O.GetBO.SymbolNameBySymbolID(SymbolID)).Name
Dim result As VertexFXBridgeAPI.TransResult
symbName=Trim(symbName)
result = LP.GetLPs.Item(1).LP.NewLimitOrder(BuySell,Amount, symbName, price, symbName ,symbName)
If result.Succeeded Then
GUI.addLog("The order #" & TicketOrder & " reflected in LP side successfully")
else
GUI.addLog("Unsuccessfully to reflect order #" & TicketOrder &" in LP side due to " & result.message )
end if
end if
end if
Catch ex As Exception
GUI.addlog(System.Reflection.MethodInfo.GetCurrent Method().Name & ":" & ex.Message)
End Try
End Sub