Dukascopy
 
 
Wiki JStore Search Login

VJF strategy not executing in Historical Tester
 Post subject: VJF strategy not executing in Historical Tester Post rating: 0   New post Posted: Fri 06 Nov, 2015, 12:13 
User avatar

User rating: 0
Joined: Tue 03 Nov, 2015, 08:29
Posts: 1
Location: South Africa,
Hi Anyone,

Is there any obvious reason why a strategy that successfully runs in vJF should not run in the JForex Historical Tester (in both my live and demo accounts?).

I have copied and pasted the code to create the strategy from vJF into the Jforex platform and have received no error messages after compiling the strategy. When I run the strategy, the historical tester goes through the motions of processing the ticks, but no orders are executed as programmed.

I tested it on the data of the previous week and changed nothing of any of the pre-set parameters and setting.

Any feedback would be greatly appreciated, thanks.


 
 Post subject: Re: VJF strategy not executing in Historical Tester Post rating: 0   New post Posted: Fri 06 Nov, 2015, 17:13 
Visual JForex expert at Dukascopy
User avatar

User rating: 288
Joined: Thu 18 Apr, 2013, 09:26
Posts: 1496
Location: Switzerland, Geneva
Hi,

There is some mandatory conditions to be added to a VJF strategy so that it runs properly in Jforex but if you attach your strategy I can highlight what went wrong.

Thanks


 
 Post subject: Re: VJF strategy not executing in Historical Tester Post rating: 0   New post Posted: Sun 08 Nov, 2015, 17:52 
User avatar

User rating: 0
Joined: Sun 08 Nov, 2015, 17:44
Posts: 4
Dear Amine,

Thank you for taking the time.

I seem to have a technical problem during the up-load of the strategy file. I receive the following error message from the forum board: "Sorry, the board attachment quota has been reached" - any alternative suggestions?

The .vfs file size is about 49KB.

Regards,


 
 Post subject: Re: VJF strategy not executing in Historical Tester Post rating: 0   New post Posted: Mon 09 Nov, 2015, 13:17 
Visual JForex expert at Dukascopy
User avatar

User rating: 288
Joined: Thu 18 Apr, 2013, 09:26
Posts: 1496
Location: Switzerland, Geneva
Hi

Can you please try again now ? alternatively you can send your file to [email protected] addressed to me.

Thanks


 
 Post subject: Re: VJF strategy not executing in Historical Tester Post rating: 0   New post Posted: Mon 09 Nov, 2015, 15:20 
User avatar

User rating: 0
Joined: Sun 08 Nov, 2015, 17:44
Posts: 4
Hi Amine,

I have tried again, but the same error came up. So I have e-mailed it to [email protected] as you requested.

Thanks and kind regards...


 
 Post subject: Re: VJF strategy not executing in Historical Tester Post rating: 0   New post Posted: Mon 09 Nov, 2015, 17:19 
Visual JForex expert at Dukascopy
User avatar

User rating: 288
Joined: Thu 18 Apr, 2013, 09:26
Posts: 1496
Location: Switzerland, Geneva
Hi,

I received your file, thanks for that.
Could you please describe your strategy in detail ?

Thanks


 
 Post subject: Re: VJF strategy not executing in Historical Tester Post rating: 0   New post Posted: Tue 10 Nov, 2015, 05:46 
User avatar

User rating: 0
Joined: Sun 08 Nov, 2015, 17:44
Posts: 4
Hi Amine,

Yes. The strategy works in EUR/USD and works in the following way.

I selected a price level (rangeDivider) above which only short positions are entered and below which only long positions are entered. The level is set in the strategy at 1.1000.

Positions are executed only around Major levels (e.g. 1.0800, 1.0900, 1.1000, 1.1100, 1.1200 etc.) and Minor levels at 50 pips in between (e.g. 1.0850, 1.0950, 1.1050, 1.1150, 1.1250 etc.). However the trades are not executed at exactly these levels.

Shorts are executed at Major levels less 10 pips (1.1090, 1.1190, 1.1290, 1.1390 etc.) and Minor levels less 5 pips (1.1045, 1.1145, 1.1245, 1.1345 etc.).

Longs are executed at Major levels plus 10 pips (1.0910, 1.0810, 1.0710, 1.0610 etc.) and Minor levels plus 5 pips (1.0955, 1.0855, 1.0755, 1.0655 etc.).

For simplicity sake I only used Tick Bid prices to trade on. Then there is a simple fixed 40 pip take-profit, no stop-loss and the contract size is equivalent to whatever the equity is at the moment of the trade e.g. at EUR50,000 equity, the contract size will be 50,000 (or 0.05 mio).

The last thing is that the strategy may not open a position at a level if the previous trade already opened a position at that level (so, may not open consecutive positions at the same level). If it moves away from that level, opens a position at a new level, then returns to the old level, it will open a second position at that old level. This is not what I wanted, but I do not know how to program it to allow a max of only one open position per level. It is not a train smash, but it does increase my leverage risk.

For now there are no safeties built in yet (e.g. max leverage or drawdown), so the strategy is manually controlled. I will include this later as this is still a work in progress.

I hope this helps, but if I left any important info out, please let me know.

Kind regards,


 
 Post subject: Re: VJF strategy not executing in Historical Tester Post rating: 0   New post Posted: Tue 10 Nov, 2015, 16:27 
Visual JForex expert at Dukascopy
User avatar

User rating: 288
Joined: Thu 18 Apr, 2013, 09:26
Posts: 1496
Location: Switzerland, Geneva
HI,

Lets start from scratch:
The attached draft is a way to pull out your different levels, if it is okay with you then plug the remaining conditions to move forward. If not and you need to consider other levels (above or below) then feel free to add that.

Once done, I can help you with the last part:
T
Quote:
he last thing is that the strategy may not open a position at a level if the previous trade already opened a position at that level (so, may not open consecutive positions at the same level). If it moves away from that level, opens a position at a new level, then returns to the old level, it will open a second position at that old level. This is not what I wanted, but I do not know how to program it to allow a max of only one open position per level. It is not a train smash, but it does increase my leverage risk.

This should be done using "Position Viewer" block that saves all open positions info in an array of data. but the question is if a position is closed, then its data is gone with it and you need a way to keep the open price to avoid opening another one afterwards.
The use of position viewer represents the dynamic way but there is a static solution which is storing individually every open price and use it for later checks. The question here is about the number of positions to be created per trading session / day / week ?


Attachments:
DC_V1.vfs [24.76 KiB]
Downloaded 120 times
DISCLAIMER: Dukascopy Bank SA's waiver of responsability - Documents, data or information available on this webpage may be posted by third parties without Dukascopy Bank SA being obliged to make any control on their content. Anyone accessing this webpage and downloading or otherwise making use of any document, data or information found on this webpage shall do it on his/her own risks without any recourse against Dukascopy Bank SA in relation thereto or for any consequences arising to him/her or any third party from the use and/or reliance on any document, data or information found on this webpage.
 
 Post subject: Re: VJF strategy not executing in Historical Tester Post rating: 0   New post Posted: Wed 11 Nov, 2015, 12:24 
User avatar

User rating: 0
Joined: Sun 08 Nov, 2015, 17:44
Posts: 4
Hi Amine,

Thank you very much. The solution you provided is working very well (indeed much more elegant than mine!) - thanks for the tutorial!

I have inserted again the steps where the contract size is determined etc. and I have also inserted the BUY and SELL at market commands.

The strategy now executes EVERY trade at the prescribed Major and Minor levels and on the the correct sides of the rangeDivider level (1.1000). So up to this point it works perfectly.

Now I only need it to not duplicate trades at the same level while a trade at that level is still open. If a previous trade at that level is now closed, then it may open a fresh trade there again.

From your description of the static and dynamic position viewer blocks, I assume we would need a static block?

amine_chourou wrote:
The use of position viewer represents the dynamic way but there is a static solution which is storing individually every open price and use it for later checks. The question here is about the number of positions to be created per trading session / day / week ?


As I understand you, we need to identify how many trades should be stored in the static array? In my experience with this strategy some trades can remain open for months. However, we could allow for the last 50 trades to be stored - if this is what you meant.

I once again was unsuccessful in attaching the .vfs file, so I have taken the liberty of e-mailng it again to you.

Kind regards,
QDK


 
 Post subject: Re: VJF strategy not executing in Historical Tester Post rating: 0   New post Posted: Fri 20 Nov, 2015, 17:48 
Visual JForex expert at Dukascopy
User avatar

User rating: 288
Joined: Thu 18 Apr, 2013, 09:26
Posts: 1496
Location: Switzerland, Geneva
Hi,

Please check the attached example and let me know your thoughts.


Thanks


Attachments:
DC_V5(1).vfs [45.12 KiB]
Downloaded 129 times
DISCLAIMER: Dukascopy Bank SA's waiver of responsability - Documents, data or information available on this webpage may be posted by third parties without Dukascopy Bank SA being obliged to make any control on their content. Anyone accessing this webpage and downloading or otherwise making use of any document, data or information found on this webpage shall do it on his/her own risks without any recourse against Dukascopy Bank SA in relation thereto or for any consequences arising to him/her or any third party from the use and/or reliance on any document, data or information found on this webpage.
 

Jump to:  

cron
  © 1998-2024 Dukascopy® Bank SA
On-line Currency forex trading with Swiss Forex Broker - ECN Forex Brokerage,
Managed Forex Accounts, introducing forex brokers, Currency Forex Data Feed and News
Currency Forex Trading Platform provided on-line by Dukascopy.com