Different sizing value between real-time and back-test  [SOLVED]

Questions about MultiCharts and user contributed studies.
User avatar
Umb
Posts: 21
Joined: 22 Apr 2016
Location: Rome - Italy
Has thanked: 2 times

Different sizing value between real-time and back-test

Postby Umb » 22 Apr 2016

Hi all, I'm new in the forum and this is my first topic.

My easylanguage level and platform knowledge is at the beginning.

I'm having different economic values with the same number of contracts/shares between a back-test and real time entry.

Exemple:
with a real-time entry with 90 contract on EUR/USD, I can reach about 100€ with 12 pips (gain or loss); in backtesting mode I have a escursion of 800€ at pip! (same cross and contracts)

The entry code is simple:

Code: Select all

Buy ("Enter long") 90 contracts Next Bar At Market;
I'am using a Demo account with LMAX

Where is the problem? Is it a setting?

Thanks
Umb

tony
Posts: 420
Joined: 14 Jun 2013
Has thanked: 30 times
Been thanked: 81 times
Contact:

Re: Different sizing value between real-time and back-test

Postby tony » 23 Apr 2016

In backtesting buying at market or at limit should yield the same results. Whereas in production (live) buying at market yields a different value than buying at limit.

User avatar
Umb
Posts: 21
Joined: 22 Apr 2016
Location: Rome - Italy
Has thanked: 2 times

Re: Different sizing value between real-time and back-test

Postby Umb » 26 Apr 2016

I'am using only entry "at market".

Can you confirm the following formula?

Code: Select all

equity = InitialCapital+netprofit+openpositionprofit;
I'am using it to check the equity during the backtest and it show me this big escursion

User avatar
Umb
Posts: 21
Joined: 22 Apr 2016
Location: Rome - Italy
Has thanked: 2 times

Re: Different sizing value between real-time and back-test

Postby Umb » 26 Apr 2016

Hi,

I tested the code in real time during a entry and it show me this:

Initial status:
Equity = 5000.00
initialCapital=5000.00 netprofit= 0.00 openpositionprofit= 0.00

After the entry:
Equity = 4174.68
initialCapital=5000.00 netprofit= 0.00 openpositionprofit=-825.32

During the trade:
Equity = 10777.22
initialCapital=5000.00 netprofit= 0.00 openpositionprofit=5777.22
Equity = 11602.53
initialCapital=5000.00 netprofit= 0.00 openpositionprofit=6602.53

At closure:
Equity = 14903.80
initialCapital=5000.00 netprofit=9903.80 openpositionprofit= 0.00

During the whole process I could check on the chart (on the labels) the openpositionprofit and gain was about 100€ (as expected), and not 6602,53€.

So i think the problem is the equity formula...

User avatar
Umb
Posts: 21
Joined: 22 Apr 2016
Location: Rome - Italy
Has thanked: 2 times

Re: Different sizing value between real-time and back-test

Postby Umb » 26 Apr 2016

Can it be that openpositionprofit and netprofit show me the dot two place after?
openprofit 825,32 = 8,25€ ???

tony
Posts: 420
Joined: 14 Jun 2013
Has thanked: 30 times
Been thanked: 81 times
Contact:

Re: Different sizing value between real-time and back-test

Postby tony » 26 Apr 2016

I'am using only entry "at market".

Can you confirm the following formula?

Code: Select all

equity = InitialCapital+netprofit+openpositionprofit;
I'am using it to check the equity during the backtest and it show me this big escursion
If I understand correctly what you are asking, then your backtests results differ from real time because of use of market orders in realtime. I further assume your backtests are better (more profitable) than real time results. If so, here's an example why. In backtests, buying at limit or at market (I believe) will yield the same result, meaning you will be filled at the "close" which is most likely the bid versus the ask in real time. So you'll have a difference per trade equal to the bid ask spread.

User avatar
Umb
Posts: 21
Joined: 22 Apr 2016
Location: Rome - Italy
Has thanked: 2 times

Re: Different sizing value between real-time and back-test

Postby Umb » 26 Apr 2016

Hi Tony,
no, it's a little different the situation.

Also in real time the formula equity = InitialCapital+netprofit+openpositionprofit give strange results.

A profit/loss of 12 pips with 90 contracts it's about 100€ watching the labels on the chart, but reading in real time the printed output of openpositionprofit code, with 12 pips I have a profit/loss too huge.

I read that netprofit and openpositionprofit give results in dollars, but a conversion doesn't solve the problem.

It'like 1 contract = 1 microlot; but reading the debug message it's like 1 contract = 1 lot

User avatar
Umb
Posts: 21
Joined: 22 Apr 2016
Location: Rome - Italy
Has thanked: 2 times

Re: Different sizing value between real-time and back-test

Postby Umb » 26 Apr 2016

The strategy performance report show the the attached results... one shot one kill, with entry position size of 90 contracts and 12 pips against...
Attachments
Immagine.png
(40.53 KiB) Downloaded 906 times

User avatar
Henry MultiСharts
Posts: 9165
Joined: 25 Aug 2011
Has thanked: 1264 times
Been thanked: 2957 times

Re: Different sizing value between real-time and back-test  [SOLVED]

Postby Henry MultiСharts » 26 Apr 2016

Hello Umb,

Please go to QuoteManager->Edit symbol->Settings tab, make sure the Big Point Value for the instrument is set to 1000.
If it was different then you need to close/open your existing charts to have the changes applied.

User avatar
Umb
Posts: 21
Joined: 22 Apr 2016
Location: Rome - Italy
Has thanked: 2 times

Re: Different sizing value between real-time and back-test

Postby Umb » 26 Apr 2016

Hi Henry,

thanks a lot, now it works


Return to “MultiCharts”