Dukascopy
 
 
Wiki JStore Search Login

Strategy opening to many positions & not closing positions when account in profit
 Post subject: Strategy opening to many positions & not closing positions when account in profit Post rating: 0   New post Posted: Tue 28 Jun, 2016, 11:01 
User avatar

User rating: 0
Joined: Mon 27 Jun, 2016, 12:02
Posts: 3
Location: New Zealand,
:mrgreen:

Hi,

Having a go at the Visual JForex platform (which is impressive).

I have a simple strategy, which opens a long pos in AUDCHF and a short pos on AUDCAD. Conditions for opening is when there are opposing candles on the 2 charts (not important).

1) Sometimes it appears that 4 positions are opened at same time when strategy euns. I am checking to see that there is only 2 positions (open or pending) but this does not appear to stop the strategy from opening more positions.

2) I can see the account with open positions going into profit, at which point I want to close all positions when the account PL is above $0.50 (arbitrary value). What am I doing wrong? Using wrong variable?

I have only run this against the historical tester, so not sure if I have setup issue there.

Cheers,

Stefan


Attachments:
Candle_Diff8.vfs [36.88 KiB]
Downloaded 132 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: Strategy opening to many positions & not closing positions when account in profit Post rating: 0   New post Posted: Tue 28 Jun, 2016, 16:19 
Visual JForex expert at Dukascopy
User avatar

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

Thanks for your comment, hope you'll enjoy the platform more and more !

1/ Could you please tell whether you're testing in VJF platform or Jforex ? (Do you export your strategy to Jforex to test ?)
2/ I've made some modifications to your strategy :
The use of variable : "Trade event: P&L ..." belongs to the type "Trade Event" which is basically a method that is based on trade messages received : So if there is no any message received by the platform then this method will never be executed. For your case, you would need slightly more frequent check: that is the reason why I plugged your position veiwer out of the OnCandle (out of the period filter so that it will be executed every minimum candle period i.e 10 sec)

Please test and let us know your thoughts
PS: If you want to test on each currency, you have to set the default instrument as per the needed currency and launch the historical tester then repeat the operation with other currency pair.

Cheers


Attachments:
Candle_Diff8.vfs [36.82 KiB]
Downloaded 144 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: Strategy opening to many positions & not closing positions when account in profit Post rating: 0   New post Posted: Wed 29 Jun, 2016, 09:00 
User avatar

User rating: 0
Joined: Mon 27 Jun, 2016, 12:02
Posts: 3
Location: New Zealand,
Hi Amine,

Thanks for your prompt response.

I was saving/compiling in Visual JForex, and then opening the file from JForex and testing it in the Historical tester.

I have just tried to run the strategy in Visual JForex, but this seems to hang - I get the blue arrows turning round & round for some time, and then an empty graph window pops up, but with no results.

Am I too impatient?

I have looked at your mods and understand most of what you did. I will do some more testing and see how I go.

Regards,

Stefan


 

Jump to:  

cron
  © 1998-2025 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