Backtesting with Virtual Trades? - page 2

 
Marco vd Heijden:

There is no need to run multiple charts with such strategy, at least when it is automated.

Multiple charts imply that it is used for a manual strategy and a visual representation.

You can open a virtual position on any time and on any instrument regardless of chart instrument and timeframe.

This means you do it all from one chart that has one expert loaded.

What you can not do in some occasions is place real trades (in tester) and that is why you have to run multiple tests and combine the results.

Maybe i just did not understand your question correctly.


If you want to do multi instrument testing then picking MT4 for that might be the worst possible solution you can pick and there could be better ways.

But once more that does not mean that it is 'impossible' 

Yes, I think maybe understanding is a little mixed, perhaps I could explain it better..

It does use fully automated strategies. (It has flexible configuration so can support some wide variations)
I think the best way to explain it's core trading would be if you consider a grid strategy, only instead of placing real trades for the 1st, 2nd, 3rd... trades, it instead initially counts virtual trades up to a pre-defined number then only starts placing real trades once the same criteria continue to be met.

 
Enrique Dangeroux:

Maybe this can help 

https://www.mql5.com/en/code/22577

Thank you, I'll have a good read through..
 
drayzen:

Yes, I think maybe understanding is a little mixed, perhaps I could explain it better..

It does use fully automated strategies. (It has flexible configuration so can support some wide variations)
I think the best way to explain it's core trading would be if you consider a grid strategy, only instead of placing real trades for the 1st, 2nd, 3rd... trades, it instead initially counts virtual trades and only starts placing real trades once criteria are met. 

That does not sound like multi instrument so i wonder why you would need multiple chart's.

If its just a grid on one instruments, with or without virtual positions, it's just like any other single instrument robot and it should be peanut's as compared to what i was just describing.

 
Marco vd Heijden:

That does not sound like multi instrument so i wonder why you would need multiple chart's.

If its just a grid on one instruments, with or without virtual positions, it's just like any other single instrument robot and it should be peanut's as compared to what i was just describing.

Yes, it can be run to trade a single symbol and requires only one chart for this. Trading more symbols requires more instances be run on additional charts. The referencing of statistics as a group of all charts or only the instance's own chart is optional, so in terms of being able to run optimisation backtests this functionality would be turned off.
 

Okay let's just say it's in an early stage of development then.

I was thrown off because you used the word hedged in your initial description which made me think that you were tracking the movement of other instruments in realtime by using virtual positions.

I don't know what to say otherwise but if your developer is telling you that it's impossible to track virtual positions on one chart and one instrument on a grid then you might want to look around because these EA's are quite common these day's.

This means it's not only possible, but that it is also already widely available, but you usually will just find that out afterwards.

 
Marco vd Heijden:

Okay let's just say it's in an early stage of development then.

I was thrown off because you used the word hedged in your initial description which made me think that you were tracking the movement of other instruments in realtime by using virtual positions.

I don't know what to say otherwise but if your developer is telling you that it's impossible to track virtual positions on one chart and one instrument on a grid then you might want to look around because these EA's are quite common these day's.

This means it's not only possible, but that it is also already widely available, but you usually will just find that out afterwards.

We seem to be going off on tangents through guessing about additional factors.
No, this is a finalised commercial product that I purchased and has had multiple versions released over years, so obviously there is no question as to whether virtual trades can be tracked for its trading, that has been working for a long time.

I think my proposition about using pairs of hedged trades was clearly defined, only as a possible work-around replacement for the virtual trades if using virtual trades for backtesting was known to be impossible.

The only question is whether this can definitely be done for backtesting and whether there is any substantially different coding required to work with the backtest engine than what is used for normal trading.
 

The difference in coding is like day and night.

Your proposition about using pairs of hedged trades was not clearly defined.

drayzen:

 One idea I had was the the EA could have a Backtest Mode where instead of executing it's virtual trades it would place 2x 0.01 real hedged trades, thus having minimal impact on the final outcome, to enable the virtual trade counters to trigger and work it's way towards placing it's real trades.

What does this mean ? 

Is it virtual positions on the same instrument ? or is it virtual positions on multiple instrument's ?

In any case i assumed you meant the involvement of other instruments in the same strategy.

That differs a lot then opening multiple positions on the same instrument and considering it a hedge, this is a common used misconception.

In the case that i had assumed you meant, you track every position on every instrument that is in the strategy at the same time on the same chart.

Now that is clearly defined.

 
Marco vd Heijden:

The difference in coding is like day and night.

Your proposition about using pairs of hedged trades was not clearly defined.

What does this mean ? 

Is it virtual positions on the same instrument ? or is it virtual positions on multiple instrument's ?

In any case i assumed you meant the involvement of other instruments in the same strategy.

That differs a lot then opening multiple positions on the same instrument and considering it a hedge, this is a common used misconception.

In the case that i had assumed you meant, you track every position on every instrument that is in the strategy at the same time on the same chart.

Now that is clearly defined.

It was clear enough that I was talking about a work around to substitute for virtual trades.
Regardless, it is also clear that was not the purpose of my question, nor was arguing about things I never mentioned, such as multiple instruments.

You keep responding, yet every time get further away from answering my actual question with any clarity. How is this of any help whatsover: "The difference in coding is like day and night." Could you possibly come up with a more nondescript answer..?
 

It wasn't clear to me.

Day and night relates to the initial thought i had about the mechanics of your strategy.

That was about pushing the tester to it's limits and not about testing some singmple strategy.

Since my answers are of no help i better go help someone else.

Good Luck.

 
tickfenix:


Virtual Position Graph

Normal Position Graph

Virtual Position Backtest

Normal Position Backtest


Multi-Instrument



With MQL5, everything is possible.

Hi tickenfix,
Thank you for your examples, that gives clear "proof of life"..  ;D

A few related Q's if you don't mind:
• Did you use the library linked to by Enrique for your coding, or created it all yourself from scratch?
• I see you have separate tests for Normal and Virtual, would you see any issue that would prevent being able to have both Normal and Virtual trades together in the same backtest?
• Do you know if the same can be achieved using MQL4, or it would be necessary to move to MQL5?

thanks again!

Reason: