Dukascopy Support Board
http://www.dukascopy.com/swiss/english/forex/jforex/forum/

Difference between 'Historical testing' and 'Demo Live data'
http://www.dukascopy.com/swiss/english/forex/jforex/forum/viewtopic.php?f=146&t=53303
Page 1 of 1

Author:  bradrtony [ Mon 02 Nov, 2015, 16:46 ]
Post subject:  Difference between 'Historical testing' and 'Demo Live data'

Dears,

I am experiencing different results between historical and demo testing.

Any idea?

Thanks,
Antony

Author:  amine_chourou [ Mon 02 Nov, 2015, 17:43 ]
Post subject:  Re: Difference between 'Historical testing' and 'Demo Live data'

Hi,

Can you please elaborate on that ?

Historical tester of VJF and Historical tester of JForex ? same run-time parameters ? Real time tests as well ?? could you please attach the strategy in question

Thanks

Author:  bradrtony [ Mon 02 Nov, 2015, 18:04 ]
Post subject:  Re: Difference between 'Historical testing' and 'Demo Live data'

Hi Amine,

thanks for heads up :)

- historical testing on Visual (all good)
- historical testing on Jforex (not tested)
- demo on Jforex (errors)
- live on Jforex (errors)

Questions welcome,
A.

Author:  amine_chourou [ Tue 03 Nov, 2015, 09:38 ]
Post subject:  Re: Difference between 'Historical testing' and 'Demo Live data'

Hi,

What are the errors ? any vfs file ?

Thx

Author:  bradrtony [ Tue 03 Nov, 2015, 14:06 ]
Post subject:  Re: Difference between 'Historical testing' and 'Demo Live data'

Thanks for your attention, at the moment it looks that it is all about my overlooked 'coding mistakes'.

Author:  bradrtony [ Wed 04 Nov, 2015, 17:11 ]
Post subject:  Re: Difference between 'Historical testing' and 'Demo Live data'

Well, finally just one error, that is:
- sometimes (lets say in one case out of seven) the entry pending order is duplicated)
- have no idea why this is happening
- most confusing is that it is not happening everytime

Thanks for possible hep or idea what to do.

Appreciate,
Antony

Attachments:
DC_BuySell_V1.vfs [84.33 KiB]
Downloaded 102 times

Author:  amine_chourou [ Thu 05 Nov, 2015, 15:48 ]
Post subject:  Re: Difference between 'Historical testing' and 'Demo Live data'

Hi,

The error comes from the following blocks (on both BUY and SELL sides):

Image

The IF block at the right side comparing last tick time > expiry time doesn't add any information as it is always the case.
If I associate the conditions having All position and pending position variables (the 2 IF blocks in the left side of the pic) then I come to the following statements:
Out of the first IF: there is a case where you have 2 pending orders (One Buy Stop plus its linked SL order) There is a case where 1 pending order is submitted and a case where you can have 1 position + 1 SL (in case a Stop BUY gets filled) --> SO out of this condition you go and compare tick time Vs Expiry time (always true) and then comes the second IF to check if there is no pending positions at all ??!!! this case never happens in other words.
back to the first IF: the "equal' is the only valid exit when associated with the second IF which result in order creation

If you're looking to update the expiry time ONCE the pending order is placed AND not yet filled then it is another story


I don't get what are you willing to achieve using these 3 blocks, can you please explain ?

Thanks in advance

Attachments:
Error.JPG [109.11 KiB]
Downloaded 431 times

Author:  bradrtony [ Thu 05 Nov, 2015, 17:42 ]
Post subject:  Re: Difference between 'Historical testing' and 'Demo Live data'

Hi Amine, I am happy to explain:

FIRST IF BLOCK is a question, if there is any position (pending or filled) at all (comparing allPositions to ZERO)
- if the answer is GREATER THAN ZERO (means there are some (pending or filled) positions)... than .... goto SECOND IF BLOCK
- if the answer is EQUAL, that means no position at all (pending or filled) .... than .... goto THIRD IF BLOCK

SECOND IF BLOCK
- last tick time IS GREATER than ExpiryTime .. means there is NOT any pending order with grater Expiration THAN current LastTick
(thus this block is used for single purpose, that is to AVOID opening pending order once the previous was not filled or expired)

THIRD IF BLOCK
... so we can get into this block by two ways
a) directly from FIRST IF BLOCK (that is when no positions exist)
b) through SECOND IF BLOCK, but only if there is not any pending order)
... at least I hope so


So let me clarify what is the intension:

- to AVOID opening new pending order before the expiration of the previous pending order (does not matter if the previous pending order got filled)

example:
at 10:00min no positions at all
at 10:05min first pending order is created with Expiration 60 sec (say from 10:05:00sec to 10:05:59sec)
... the intension of these three IF BLOCKS is not to open any new pending order before 10.06.00sec)


Appreciate your help!
Antony

Author:  amine_chourou [ Fri 06 Nov, 2015, 10:53 ]
Post subject:  Re: Difference between 'Historical testing' and 'Demo Live data'

Hi,

Assuming the following statement:
Quote:
- to AVOID opening new pending order before the expiration of the previous pending order (does not matter if the previous pending order got filled)

and the example provided, you can do that using pending position variable.
I modified your strtaegy in the attached example as per the above and I also modified the way the expiration is plugged because I noticed that there was one case where the order did not get the right validity and I'm suspecting the use of Tick price plugged to onCandle is not updating properly.
There is also another error related to LowestAsk / Highest Ask prices where they don't get a start value...

Cheers

Author:  amine_chourou [ Fri 06 Nov, 2015, 11:07 ]
Post subject:  Re: Difference between 'Historical testing' and 'Demo Live data'

With the strategy attached ...

Attachments:
DC_BuySell_V3.vfs [84.18 KiB]
Downloaded 113 times

Author:  bradrtony [ Fri 06 Nov, 2015, 11:19 ]
Post subject:  Re: Difference between 'Historical testing' and 'Demo Live data'

Regarding "LowestAsk / Highest Ask prices where they don't get a start value..."
- I did find more useful and probably more simple way to proceed with BIDs only and to implement spread calculation for the 'BUY SIDE''

Update soon, big thanks and have a good weekend,
A.

Author:  amine_chourou [ Fri 06 Nov, 2015, 11:45 ]
Post subject:  Re: Difference between 'Historical testing' and 'Demo Live data'

One more detail:
Assuming that you agree to open order regardless of previous orders that got filled you also agree to have many positions opened (long and short).

Author:  bradrtony [ Fri 06 Nov, 2015, 11:50 ]
Post subject:  Re: Difference between 'Historical testing' and 'Demo Live data'

Hi Amine,

one thing is missing, and that is this scenario:

example:

10:00:00 no orders at all
10:01:00 new pendingOrder1 placed
10:01:30 pendingOrder1 got filled

.. and now new pending order can be placed, but it should not be before pendingOrder1 expiration, that is before 10:02:00

What do you think?

Author:  bradrtony [ Fri 06 Nov, 2015, 12:01 ]
Post subject:  Re: Difference between 'Historical testing' and 'Demo Live data'

amine_chourou wrote:
One more detail:
Assuming that you agree to open order regardless of previous orders that got filled you also agree to have many positions opened (long and short).


that is right, but not before pendingOrder1 expiration (of my example above)

Author:  amine_chourou [ Fri 06 Nov, 2015, 15:32 ]
Post subject:  Re: Difference between 'Historical testing' and 'Demo Live data'

Yes, And the strategy attached should handle the above as well.

Author:  bradrtony [ Fri 06 Nov, 2015, 15:55 ]
Post subject:  Re: Difference between 'Historical testing' and 'Demo Live data'

Based on my Jforex historical testing, it is not. It is still (time to time) open two orders in one moment.

In my opinion, it is because new pending order can be opened whenever there is no other pending order. BUT, the is no filter not to be opening new pending order for 60 sec from last placement (of pending order).

Author:  amine_chourou [ Mon 09 Nov, 2015, 10:23 ]
Post subject:  Re: Difference between 'Historical testing' and 'Demo Live data'

Hi,

Can you show an example including date and time of the trades /orders showing the following:
Quote:
Based on my Jforex historical testing, it is not. It is still (time to time) open two orders in one moment.


Quote:
In my opinion, it is because new pending order can be opened whenever there is no other pending order

It should not, otherwise it is a bug if the above is confirmed.

Quote:
BUT, the is no filter not to be opening new pending order for 60 sec from last placement (of pending order).

There is no need for that as it is still an order in "open" status till it expires and then it will switch to "cancelled"

Thanks

Author:  bradrtony [ Mon 09 Nov, 2015, 21:59 ]
Post subject:  Re: Difference between 'Historical testing' and 'Demo Live data'

I did uncover the trouble :).

Your help / blocks correction was sufficient, but based on more complicated strategy / and more options how to get entry signal / it was possible that two different signals got through the gate almost at the same time. Thus, even despite the filter to open max one pending order, two have been opened, because the second signal got through the gate BEFORE the first signal was executed into pending order placement.

A.

  Page 1 of 1