PDA

View Full Version : TP and SL as a percentage on the deposit value

Muneeb100
01-27-2014, 06:14 PM
We need to show the TP and SL as a percentage on the deposit value of the trade. Can you tell me how we can change this, as Quantal Trading is based on Binary Trading, so all we are looking for is a movement of the price in either short / long.
E.g., if a deposit is \$100, and the trader places 10% on Short, then their stop loss would be \$100 - 10% (\$10) if the trade goes against them, and TP would be vice versa \$100 + 10% (\$10) if the trader wins. What would be

Can we use NewLimitOrder service to achieve that? What would be the appropiate SL,TP conversion for this scenario?

Hassan-HS
01-28-2014, 11:14 AM
Hello Muneeb..

Can we use NewLimitOrder service to achieve that? What would be the appropriate SL,TP conversion for this scenario?

1- No you have to use NewOrder (http://www.hybrid-solutions.com/support/index.php?/Knowledgebase/Article/View/1952)method.
2-After placing the position using the previous method, then you have to mange it using NewManageSLTP (http://www.hybrid-solutions.com/support/index.php?/Knowledgebase/Article/View/1951)method.
3- To calculate the profit or the loss use the following formulas based on the following symbol settings:

Symbol Settings:

Contract Size
Ref Symbol
Direct/Indirect
Multiplication/Division

Formulas:

Direct & Ref symbol calculation = multiplication
Profit/ loss = Amount * ( Contract size * (Close price - Open Price ) * Ref Close Price)

Direct & Ref symbol calculation = Division
Profit/ loss = Amount * ( Contract size * (Close price - Open Price ) * (1/ Ref Close Price))

Indirect & Ref symbol calculation = multiplication
Profit/ loss = Amount * ( Contract size * ((1/Close price) - (1/Open Price) ) * Ref Close Price)

Indirect & Ref symbol calculation = Division
Profit/ loss = Amount * ( Contract size * ((1/Close price) - (1/Open Price) ) * (1/ Ref Close Price))

Example

Gold Setting Is :

Gold Contract Size=100
Ref Symbol=(USD)
Direct
Multiplication

Buy 1.0 lot Gold at price 2.00 and close it at 2.01 ------> profit= 1 / (USD)

that means 0.01 profit = 1/USD price.
So you have to calculate the SL & TP according to this value and pass them to NewManageSLTP (http://www.hybrid-solutions.com/support/index.php?/Knowledgebase/Article/View/1951)

Note: Please tell your dealing room to set your Limit offset & Manage offset to be equal zero to avoid invalid price result.

Muneeb100
01-28-2014, 12:46 PM
Thanks for the help!

I am still a little confused about how we can make Short/Long trading.

Currently, I understand that you want me to place a new order using NewOrder service and modify the TP/SL values using NewManageSLTP. The problem is that Short/Long trading works in different way.

We need the ability to 1) enable long /short orders, which is based on the tp and sp but this is not proving able to do based on what the api is provided, 2) we want to display risk value, which is proportionate to the sp/tp - we were given but this is also not working, and lastly, 3) expiry time, as a binary, we need to enable expiry time which will stop out the trade, but throught he api we are not able to do this?

Hassan-HS
01-28-2014, 02:47 PM
Dear muneeb..

1) enable long /short orders, which is based on the tp and sp but this is not proving able to do based on what the api is provided

You can to pass order type (1 ,-1) which decide the type of the order to NewOrder (http://www.hybrid-solutions.com/support/index.php?/Knowledgebase/Article/View/1952) function.

1 means long.
-1 means short.

Directly you can mange its SL/TP using NewManageSLTP (http://www.hybrid-solutions.com/support/index.php?/Knowledgebase/Article/View/1951).

2) we want to display risk value, which is proportionate to the sp/tp - we were given but this is also not working

this point its not clear to me..

3) expiry time, as a binary, we need to enable expiry time which will stop out the trade, but throught he api we are not able to do this?

you can develop a timer for orders and when its exceeded a specific period you have to close the order using this function (http://www.hybrid-solutions.com/support/index.php?/Knowledgebase/Article/View/1929).