Dukascopy
 
 
Wiki JStore Search Login

Strategy opens more trades than set in parameters
 Post subject: Strategy opens more trades than set in parameters Post rating: 0   New post Posted: Tue 09 Sep, 2014, 14:15 
User avatar

User rating: 0
Joined: Sun 30 Jun, 2013, 21:59
Posts: 5
Location: Lithuania, Vilnius
Hello,

I made strategy in visual jforex dedicated for sharp moves catching with limitation to 1 opened trade in default instrument (EUR/USD). I use counting of open positions which instrument equals to default instrument and if number of positions is 0 strategy goes to logic which is responsible for decisions to open position or not. In another case strategy goes to logic which is responsible for closing position if certain criteria are met.

After that I built strategy and copied code to jforex platform. But when it runs live I noticed that in about 50% cases not 1 but 2,3 or even 4 positions are opened at nearly same time. Please check why set limitation works incorrectly.

And I cannot attach visual jforex strategy file - I get message "Sorry, the board attachment quota has been reached."
Maybe I can sent this file by e-mail?

Best regards,
rokasltu


 
 Post subject: Re: Strategy opens more trades than set in parameters Post rating: 0   New post Posted: Tue 09 Sep, 2014, 16:15 
Visual JForex expert at Dukascopy
User avatar

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

Thanks for your post.
Kindly resend your email with the attachment to [email protected] and address it to me. I'll follow up and keep you updated.

Thanks


 
 Post subject: Re: Strategy opens more trades than set in parameters Post rating: 0   New post Posted: Wed 10 Sep, 2014, 12:22 
Visual JForex expert at Dukascopy
User avatar

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

We've received your strategy and thanks for that.
Can you please explain your use of the counter as it I did not understand it (the number calculation). Why are you using it ?
If your aim is limit the open positions to one then a simple IF condition with the number of position is enough.
In addition, the position viewer block could be limited to one.

Thanks


 
 Post subject: Re: Strategy opens more trades than set in parameters Post rating: 0   New post Posted: Wed 10 Sep, 2014, 12:45 
User avatar

User rating: 0
Joined: Sun 30 Jun, 2013, 21:59
Posts: 5
Location: Lithuania, Vilnius
Hi,

As besides jforex robot I also trade manually in another currency pairs and if there are open positions in another currency pairs but not in currency pair EUR/USD which is used for automated trading and another criteria are met robot should open EUR/USD position. (along another open positions in another currency pairs)

That's why I use position viewer block for going through of all open position but variable "number" is increased by 1 only in case open position instrument is equal to EUR/USD.

After counting is done my logic splits in two parts: if there is no open position in EUR/USD ("number"=0) it goes to part which decides to open position or not and if there is open position already (and as I mentioned in about 50% of cases there are more than 1 open position in EUR/USD) it goes to part which decides to close this position or not. In this part I also use position viewer block in order to go through all open positions but to proceed with possible closing only if open position instrument is equal to EUR/USD.

That's is reason for using mentioned logic. But as I mention robot opens more than 1 position in EUR/USD pair at a time and this opening happens nearly at the same time. I mean that if e.g. 3 positions are opened and some time passes (e.g. 1 second) after that robot do not open additional positions until mentioned open positions are closed. Please check why this happens.

Best regards,
rokasltu


 
 Post subject: Re: Strategy opens more trades than set in parameters Post rating: 0   New post Posted: Wed 10 Sep, 2014, 15:08 
Visual JForex expert at Dukascopy
User avatar

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

This behavior is quite random but as you are trading on tick start + the way you assembled your blocks increases the chances of getting more then one position.
I believe there is another workaround. I'll try to check this and get back to you asap.

Thanks


 
 Post subject: Re: Strategy opens more trades than set in parameters Post rating: 0   New post Posted: Mon 27 Mar, 2017, 18:30 
User avatar

User rating: 1
Joined: Tue 12 May, 2015, 18:13
Posts: 34
Location: United Kingdom, Headington
I wanted to add I have observed this phenomenon as well. Using position viewer to limit trades to , for example, EURUSD, it will open a trade as long as no other EURUSD positions are open. However sometimes I think the strategy loses connection maybe to the server info that gives it the positioninfo and positioninstrument count, then it thinks those values are 0, so it allows another trade to go through?

That is my theory anyway.


 
 Post subject: Re: Strategy opens more trades than set in parameters Post rating: 0   New post Posted: Tue 28 Mar, 2017, 14:12 
Visual JForex expert at Dukascopy
User avatar

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

Things has changed since the beginning of this post and the Variables "Positions" in the left panel use to be linked to the used instrument only but since more than a year the position amount variable handles any open position.
Also, the position viewer block can handle positions per traded instrument. Check the attached "random" example

Image

Besides, we have currently an outstanding issue related to strategy processor connectivity, so this might impact the normal behavior of a strategy at some point.

If you need an counter per open position and traded instrument let me know


Attachments:
CLoseEURUSDwithSLAndAnyEURCHF.JPG [110.83 KiB]
Downloaded 227 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-2011 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