Dukascopy
 
 
Wiki JStore Search Login

Open Position do not close
 Post subject: Open Position do not close Post rating: 0   New post Posted: Tue 18 Aug, 2015, 08:45 
User avatar

User rating: 0
Joined: Wed 18 Mar, 2015, 14:18
Posts: 7
Location: Germany, Berlin
Hello,

in my strategy, open positions would not close and I don't know why. The idea is, if the last candle close below/above the 100 EMA go to check if a position is open and check if it is a long position. If it's true/false, close this open position and open a short/long position. But, whatever I do, open positions do not close. :)

So long
Marco


Attachments:
emarun06.vfs [39.72 KiB]
Downloaded 162 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: Open Position do not close Post rating: 0   New post Posted: Thu 27 Aug, 2015, 11:45 
Visual JForex expert at Dukascopy
User avatar

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

Sorry for the delayed answer.
Actually the error is in your workflow: The Get historical candle and the EMA are connected after the position number check. In other words, the EMA egts calculated only if there is no open positions and the historical candle's OHLC as well. Therefore your condition to close the position if the EMA crossover is only checked when no position is opened which doesn't make any sense.
Attached a corrected version for your consideration

ps: I removed the SL levels for testing purposes in the attached example but you can put them back

Cheers


Attachments:
emarun06_V2.vfs [43.25 KiB]
Downloaded 143 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: Open Position do not close Post rating: 0   New post Posted: Sun 30 Aug, 2015, 21:59 
User avatar

User rating: 0
Joined: Wed 18 Mar, 2015, 14:18
Posts: 7
Location: Germany, Berlin
Ah, you are right. It works now. Yeah. :)

Thanks!

So long
Marco


 

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