How to calculate current equity when back testing in Forex? - page 2

Thank you for confirming. When incorporating the spread into my calculations I’d assume it goes something like this:

(Close – Open) * Lot / quote currency.

When going long, the open = buy (Ask) and the close = sell (Bid)

When going short, the open = sell (Bid) and the close = buy (Ask)

I have managed to calculate a single order on my spreadsheet so thank you very much for the calculation formulae; I’ll make that my research topic for today and do some proper number crunching this afternoon.

I’ll also do a bit more research on leverage so I’ll most likely create a new thread with a whole bunch of questions once I’ve done my initial learning.

You’ve been a massive help at the start of my journey, wishing you plenty of positive trades,

CPerry.

CPerry #: When incorporating the spread into my calculations I’d assume it goes something like this:

When I stated that I was not sure about using ask/bid prices, I was referring to the currency conversion, not about the the opening and closing prices of positions of going long or short.

Oh my misunderstanding, the last part of the aforementioned formula ends with "/ quote currency" so wouldn't it just close with the Bid price when going long and Ask when going short to wrap the formula up and convert the currency?

CPerry #: Oh my misunderstanding, the last part of the aforementioned formula ends with "/ quote currency" so wouldn't it just close with the Bid price when going long and Ask when going short to wrap the formula up and convert the currency?

Firstly, one does not need to convert from the Base currency to the Quote currency. One needs only convert the profit expressed in the Quote currency into the Account currency. When you trade a currency pair, the position's gain is easily expressed in the quote currency, and its from this quote currency that one then converts to the account currency.

If you are trading xxx/USD currency pairs, then your gains are usually \$10 (USD) per pip-lot, which you then convert into your account currency (e.g. GBP). It is during this conversion that one needs to use the correct Bid or Ask of the currency pair you need to consult and in this case you would buy GBP/USD (buy GBP, sell USD), to convert USD to GBP, which means you use the Ask price of GBP/USD for the conversion.

If your account currency were JPY, however, you would need to sell USD/JPY (sell USD, buy JPY) to convert USD into JPY, you would need to use Bid price of USD/JPY for the conversion.

That been said, I highly suggest you research this properly on your own and not take my word for it, because I have not paper traded for a very long time and my memory may be hazy. Since I now trade with EA's, and MetaTrader does all that stuff for me, I'm a little rusty when it comes to the conversion calculations.

Thank you for the guidance. I've done a bit more research and it's all starting to make a lot of sense now. I'm still a pretty big handful of mistakes away from getting all my models spot on but i'm getting there.

There are a lot of moving parts to consider for sure!

CPerry.

@Fernando Carreiro Me again!

I have got my modelling spreadsheet working with multiple buy orders now, so going long is working. Going short, I’m still working on. Implementing the calculations is frustratingly humbling me but I’m getting there.

I was compelled to check my buy calculations against a forex profit calculator online and much to my shock, I found the following (apologies if I’m not allowed to post these links, I’m happy for moderators to remove if I’m breaking any rules):

Sell GBP/USD at: 1.775401

Trading one standard lot. Account currency is GBP.

£ 4603.84884

£4,930.16

£4,930.21

£4,929.26

The last one did also have a value showing me 567.94 pips so that part of the calculation is at least correct. I am shocked to see how every single one of these is different, the first one by a few hundred pounds!!

Even more worrying however is how they compare to my calculation which we have previously discussed:

(Close – Open) * Lot / Quote Currency

(1.775401 – 1.718607) = 0.056794 points = 567.94 pips

567.94 pips * 10 (one lot) = \$5679.40

\$5679.40 / 1.775401 = £3198.94

This value is so far off the others!! What is going on?

CPerry.

CPerry #I have got my modelling spreadsheet working with multiple buy orders now, so going long is working. Going short, I’m still working on. Implementing the calculations is frustratingly humbling me but I’m getting there.

I was compelled to check my buy calculations against a forex profit calculator online and much to my shock, I found the following:

Buy GBP/USD at: 1.718607, Sell GBP/USD at: 1.775401, Trading one standard lot. Account currency is GBP.

£ 4603.84884; £4,930.16; £4,930.21; £4,929.26

The last one did also have a value showing me 567.94 pips so that part of the calculation is at least correct. I am shocked to see how every single one of these is different, the first one by a few hundred pounds!!

Even more worrying however is how they compare to my calculation which we have previously discussed:

(Close – Open) * Lot / Quote Currency

(1.775401 – 1.718607) = 0.056794 points = 567.94 pips

567.94 pips * 10 (one lot) = \$5679.40

\$5679.40 / 1.775401 = £3198.94

This value is so far off the others!! What is going on?

In all those cases, they are probably using the current prices or previous day close prices for the currency conversion, and not the "closing price" that you gave. Currently my GBP/USD ask price is 1.15121, so ...

\$5679.40 / 1.15121 = £4933.42

@Fernando Carreiro

How strange. All of those free calculators have a box where you type in a 'closing price' but I think you're right, dividing by 1.15121 gives your answer which is very close to their numbers. Rather frustrating that ALL of these vales are different. 5p compounded builds very quickly, how hard is it to use a good number of decimal places in their calculations?!? I assume it must be some sort of rounding issue anyways.

This makes it really difficult to check things for myself so i'm really counting on my own calculations being correct. I am still having problems will calculating multiple sell orders (going short). It's really starting to frustrate me as i'm so close; everything else is working perfectly! My metrics all work, my data is ready and formatted and I have a systematic approach to the strategies I want to explore. I'm just too thick to work out this calculation and even worse, I know it'll just be a mirror version of the going long calculation i've already added to my code. I'm probably just missing a - somewhere. Going to go smack my head off the wall some more.

CPerry #:

@Fernando Carreiro

How strange. All of those free calculators have a box where you type in a 'closing price' but I think you're right, dividing by 1.15121 gives your answer which is very close to their numbers. Rather frustrating that ALL of these vales are different. 5p compounded builds very quickly, how hard is it to use a good number of decimal places in their calculations?!? I assume it must be some sort of rounding issue anyways.

This makes it really difficult to check things for myself so i'm really counting on my own calculations being correct. I am still having problems will calculating multiple sell orders (going short). It's really starting to frustrate me as i'm so close; everything else is working perfectly! My metrics all work, my data is ready and formatted and I have a systematic approach to the strategies I want to explore. I'm just too thick to work out this calculation and even worse, I know it'll just be a mirror version of the going long calculation i've already added to my code. I'm probably just missing a - somewhere. Going to go smack my head off the wall some more.

Just because you input a closing price, does not mean it has to use it for currency conversion. For example if you are looking at GBPUSD but want the final result in EUR, how would you convert it?

Remember, that those online calculators are used mostly by newbies that don't yet fully understand how to calculate things themselves and only need an approximate value. They should not be used for active trading.

There should be no difference or difficulty between calculating long positions or short positions. If you are having difficulty, then there is something inherently incorrect with your calculation method.

To help you out, first create a simple spreadsheet with inputs for calculating the profit (or loss) of a single position, long or short, and with currency conversion.

Post the sheet here with example trades so we may look at the formulas, and verify that you are doing it correctly.