Finding the pip profit of a forex trade

ChaosTrader63

New Member
Joined
Jun 10, 2013
Messages
6
Hello all! I am very new to the forum and even newer to excel macros and VBA. What I am trying to do is have excel calculate the amount of pip profit of a trade in forex. For instance if I was making a short or sell trade and the price was 1.3000 and price moved to 1.2950 then that would equal 50 pips profit so I just want this calculated automatically by excel. I will add the entry and exit prices manually. Also the formula has to know if it's minus profit. So with the same numbers if I was making a long or buy trade and it went from 1.3000 to 1.2950 then it should show this as -50 pips.
My cells are as follows:

B15 long or Short
B16 Entry Price
B20 Exit Price
B21 Profit/Loss in pips

Hopefully I explained this well enough and I appreciate the help. Thanks!
 

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN
Welcome to the board

Try this as formula in B21:
Code:
=IF(B15="Long",B20-B16,B16-B20)*10000
 
Upvote 0
You said Long or Short, not buy or sell. If B15=Long then my formula takes the entry price AWAY from the exit price (if long, then profit should occur when the exit price is higher than the entry price, if short, vice versea), multiplies it by 10,000 to give an answer in pips. Otherwise, because if it's not a Long then it can only be a short so the formula takes the exit price away from the entry price, before multiplying by 10,000.

Change the formula from (B15="Long" to (B15="Buy" if you're using the words Buy and Sell instead of Long and Short
 
Upvote 0
You said Long or Short, not buy or sell. If B15=Long then my formula takes the entry price AWAY from the exit price (if long, then profit should occur when the exit price is higher than the entry price, if short, vice versea), multiplies it by 10,000 to give an answer in pips. Otherwise, because if it's not a Long then it can only be a short so the formula takes the exit price away from the entry price, before multiplying by 10,000.

Change the formula from (B15="Long" to (B15="Buy" if you're using the words Buy and Sell instead of Long and Short


Your formula is bringing back minus such as -5 when it should be +5. It's doing that for both long and short so its saying long trade entry 1.30000 and exit 1.30050 = -5. Also this should say 50 and not 5.
Do I also have to place a formula in the long and short cell. I have a combo box for long and short. Once again Thanks!
 
Upvote 0
Could be because of the combo box - remove it and type in either "Long" or "Short" in cell B15. I'll try to think of a way you can use the combo box when I get into work today
 
Upvote 0
I've just set up a drop down combo box with "Long" and "Short" and it works fine for me when I switch between the two directions. Without seeing the setup of your spreadsheet, can't suggest anything else as it works for me (same cells, same formula and with a drop down box)...
 
Upvote 0
I've just set up a drop down combo box with "Long" and "Short" and it works fine for me when I switch between the two directions. Without seeing the setup of your spreadsheet, can't suggest anything else as it works for me (same cells, same formula and with a drop down box)...

I appreciate you! If it's working for you then I have to figure out the minor detail that is hindering me but mainly I have the code. Thank you!
 
Upvote 0

Forum statistics

Threads
1,223,228
Messages
6,170,875
Members
452,363
Latest member
merico17

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top