How to calculate profit from volume and pips

To add comments, please log in or register
Alireza
203
Alireza  

Hello


My question seems very simple, but I'm in doubt about the answer. If we have number of pips of profit or loss at the end of trade and also we have open and closing prices and also we have volume of trade in base currency using


OrderLots()*MarketInfo(OrderSymbol(),MODE_LOTSIZE)/AccountBalance()

How can we calculate how much is the percentage of profit or loss?


Thanks in advance

ukt
473
ukt  

Hi AR, I know not maths - is blind spot for me...


BUT - since I have not practicable alternative approach to the unending mathmatical type issues in financial trading:

have you used Print() function to 'test out' your various theories and calculation variants in noddy script testbed??


A hammer and chisel approach using iterative slog with some visual o/p via Print() is a stepwise refinement sneak up on the answer idea I personally use daily - LOL


Anyway, just a thought...


'appy calculating AR

Alireza
203
Alireza  

Well, in this special case, I prefer analytics. I think this may be more complicated than we reach the answer with try and error. I hope to use the same formula used by strategy tester or something like that.

Anyhow thanks

Alireza
203
Alireza  

I wish I could get an answer and work on it during weekend. I'm in doubt we can not use simply number of pips multiplied by number of lots for answer because base currency and trade currency are different and pip values are also different. any Idea?

thanks

Ray
2653
Ray  

How to calculate profit from volume and pips

profit = MarketInfo(Symbol(), MODE_TICKVALUE) * OrderLots() * pips;


How can we calculate how much is the percentage of profit or loss?

%profit = 100*(1-( AccountValue / (AccountValue - OrderProfit)));

Alireza
203
Alireza  
phy:

How to calculate profit from volume and pips

profit = MarketInfo(Symbol(), MODE_TICKVALUE) * OrderLots() * pips;


How can we calculate how much is the percentage of profit or loss?

%profit = 100*(1-( AccountValue / (AccountValue - OrderProfit)));

Thanks

With your answer, I can explain what I'm in doubt about:


How about revers pairs(in cases like we are using dollar as base currency).

Or generally speaking, how about situations that TICKVALUE is different at the beginning and the end of trade?

and how to distinguish these situations when our base currency is not USD? and when we have symbols other than currency pairs; something like metals, stock market quta, and ...


and

sorry, I'm confused. Isn't MarketInfo(OrderSymbol(),MODE_LOTSIZE) used?


thanks in advance.

Ray
2653
Ray  

How about revers pairs(in cases like we are using dollar as base currency).


TICKVALUE provides the conversion to your deposit currency.


Or generally speaking, how about situations that TICKVALUE is different at the beginning and the end of trade?


Your profit is calculated using the tick value at close of the trade. Dealer will tell you what your profit is, or you can estimate what he will tell you.


and how to distinguish these situations when our base currency is not USD?


TICKVALUE is in the deposit currency.


and when we have symbols other than currency pairs; something like metals, stock market quta, and ...


Profit on your trade is in your deposit currency


and sorry, I'm confused. Isn't MarketInfo(OrderSymbol(),MODE_LOTSIZE) used?


That tells you the "size" of a lot of a specified security on your Dealer's platform.



See examples below:



---------

Sample Market Info, Deposit Currency is USD

ODL Securities
ODL-MT4 Demo


Report for EURUSD

1.5428 Low day price.
1.5643 High day price.
2008.05.01 18:33:19 The last incoming tick time (last known server time).
1.5455 Last incoming bid price. For the current symbol, it is stored in the predefined variable Bid
1.5457 Last incoming ask price. For the current symbol, it is stored in the predefined variable Ask
0.0001 Point size in the quote currency. For the current symbol, it is stored in the predefined variable Point
4 Count of digits after decimal point in the symbol prices. For the current symbol, it is stored in the predefined variable Digits
2 Spread value in points.
10 Stop level in points.
100000 Lot size in the base currency.
10 Tick value in the deposit currency.
0.0001 Tick size in points.
0.3 Swap of the long position.
-0.4 Swap of the short position.
0 Market starting date (usually used for futures).
0 Market expiration date (usually used for futures).
1 Trade is allowed for the symbol.
0.1 Minimum permitted amount of a lot.
0.1 Step for changing lots.
1000 Maximum permitted amount of a lot.
0 Swap calculation method. 0 - in points; 1 - in the symbol base currency; 2 - by interest; 3 - in the margin currency.
0 Profit calculation mode. 0 - Forex; 1 - CFD; 2 - Futures.
0 Margin calculation mode. 0 - Forex; 1 - CFD; 2 - Futures; 3 - CFD for indices.
0 Initial margin requirements for 1 lot.
0 Margin to maintain open positions calculated for 1 lot.
0 Hedged margin calculated for 1 lot.
1545.7 Free margin required to open 1 lot for buying.
0 Order freeze level in points. If the execution price lies within the range defined by the freeze level, the order cannot be modified, cancelled or closed.


Report for AUDCAD

0.9448 Low day price.
0.9534 High day price.
2008.05.01 18:32:58 The last incoming tick time (last known server time).
0.949 Last incoming bid price. For the current symbol, it is stored in the predefined variable Bid
0.9497 Last incoming ask price. For the current symbol, it is stored in the predefined variable Ask
0.0001 Point size in the quote currency. For the current symbol, it is stored in the predefined variable Point
4 Count of digits after decimal point in the symbol prices. For the current symbol, it is stored in the predefined variable Digits
7 Spread value in points.
10 Stop level in points.
100000 Lot size in the base currency.
9.81643271 Tick value in the deposit currency.
0.0001 Tick size in points.
0 Swap of the long position.
0 Swap of the short position.
0 Market starting date (usually used for futures).
0 Market expiration date (usually used for futures).
1 Trade is allowed for the symbol.
0.1 Minimum permitted amount of a lot.
0.1 Step for changing lots.
1000 Maximum permitted amount of a lot.
0 Swap calculation method. 0 - in points; 1 - in the symbol base currency; 2 - by interest; 3 - in the margin currency.
0 Profit calculation mode. 0 - Forex; 1 - CFD; 2 - Futures.
0 Margin calculation mode. 0 - Forex; 1 - CFD; 2 - Futures; 3 - CFD for indices.
0 Initial margin requirements for 1 lot.
0 Margin to maintain open positions calculated for 1 lot.
0 Hedged margin calculated for 1 lot.
932.15 Free margin required to open 1 lot for buying.
0 Order freeze level in points. If the execution price lies within the range defined by the freeze level, the order cannot be modified, cancelled or closed.



Report for SLV ( Silver)

15.992 Low day price.
17.032 High day price.
2008.05.01 18:33:43 The last incoming tick time (last known server time).
16.182 Last incoming bid price. For the current symbol, it is stored in the predefined variable Bid
16.222 Last incoming ask price. For the current symbol, it is stored in the predefined variable Ask
0.001 Point size in the quote currency. For the current symbol, it is stored in the predefined variable Point
3 Count of digits after decimal point in the symbol prices. For the current symbol, it is stored in the predefined variable Digits
40 Spread value in points.
10 Stop level in points.
5000 Lot size in the base currency.
5 Tick value in the deposit currency.
0.001 Tick size in points.
-1.65 Swap of the long position.
1.45 Swap of the short position.
0 Market starting date (usually used for futures).
0 Market expiration date (usually used for futures).
1 Trade is allowed for the symbol.
0.1 Minimum permitted amount of a lot.
0.1 Step for changing lots.
1000 Maximum permitted amount of a lot.
0 Swap calculation method. 0 - in points; 1 - in the symbol base currency; 2 - by interest; 3 - in the margin currency.
1 Profit calculation mode. 0 - Forex; 1 - CFD; 2 - Futures.
4 Margin calculation mode. 0 - Forex; 1 - CFD; 2 - Futures; 3 - CFD for indices.
0 Initial margin requirements for 1 lot.
0 Margin to maintain open positions calculated for 1 lot.
0 Hedged margin calculated for 1 lot.
811.1 Free margin required to open 1 lot for buying.
0 Order freeze level in points. If the execution price lies within the range defined by the freeze level, the order cannot be modified, cancelled or closed.


Report for GLD

847.1 Low day price.
881.65 High day price.
2008.05.01 18:33:43 The last incoming tick time (last known server time).
851.2 Last incoming bid price. For the current symbol, it is stored in the predefined variable Bid
851.7 Last incoming ask price. For the current symbol, it is stored in the predefined variable Ask
0.01 Point size in the quote currency. For the current symbol, it is stored in the predefined variable Point
2 Count of digits after decimal point in the symbol prices. For the current symbol, it is stored in the predefined variable Digits
50 Spread value in points.
10 Stop level in points.
100 Lot size in the base currency.
1 Tick value in the deposit currency.
0.01 Tick size in points.
-8.25 Swap of the long position.
7.25 Swap of the short position.
0 Market starting date (usually used for futures).
0 Market expiration date (usually used for futures).
1 Trade is allowed for the symbol.
0.1 Minimum permitted amount of a lot.
0.1 Step for changing lots.
1000 Maximum permitted amount of a lot.
0 Swap calculation method. 0 - in points; 1 - in the symbol base currency; 2 - by interest; 3 - in the margin currency.
1 Profit calculation mode. 0 - Forex; 1 - CFD; 2 - Futures.
4 Margin calculation mode. 0 - Forex; 1 - CFD; 2 - Futures; 3 - CFD for indices.
0 Initial margin requirements for 1 lot.
0 Margin to maintain open positions calculated for 1 lot.
0 Hedged margin calculated for 1 lot.
851.7 Free margin required to open 1 lot for buying.
0 Order freeze level in points. If the execution price lies within the range defined by the freeze level, the order cannot be modified, cancelled or closed.

Alireza
203
Alireza  

Thanks Phy


your answer and specially your smaple were very helpful.


my last question:


shouldn't I use avrage of tick value at beginning and end?

Ray
2653
Ray  
Why?
Alireza
203
Alireza  
phy:
Why?

Once you told me that tick value at the end is important, but once more I wanted to confirm, regarding reverse pairs.

Tony
263
Tony  

Phy


Once again your concise and accurate answer helped me. I was struggling with converting a risk amount in pips to the account currency. What I did not realise from the documentation is that the TICKVALUE is for one lot, but your answer to AR78's question provided the spark of realisation ;-)


Thanks

Jellybean

To add comments, please log in or register