Dukascopy
 
 
Wiki JStore Search Login

i want only one position per every crossing ( ema50 and ema200)
 Post subject: i want only one position per every crossing ( ema50 and ema200) Post rating: 0   New post Posted: Thu 01 Oct, 2015, 19:17 
User avatar

User rating: 0
Joined: Wed 22 Feb, 2012, 12:24
Posts: 44
Location: Romania, Bucharest
Hey guys,

I want only one short position to be opened when the so called " death cross" appears ( ema 50 falls below ema200).
The same thing ( a long position) when sma50 rises above sma200.
I hope that you got the idea

I attached a simple ema strategy.
I am waiting for an answer.


Attachments:
smastrategy.vfs [33.23 KiB]
Downloaded 125 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: i want only one position per every crossing ( ema50 and ema200) Post rating: 0   New post Posted: Fri 02 Oct, 2015, 10:10 
Visual JForex expert at Dukascopy
User avatar

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

You will need to use a logical trigger instead of number of open position variable, why ? Because when you use the position amount (number of open positions) condition the system will open a new position every-time the previous one is closed within the same EMA cross scheme.
How to use a trigger ?
Create a new Boolean variable, say it has True as a start value, once a cross happens (Long entry) set the Boolean variable to False. And when the opposite cross is done then reset your trigger back to True.
This is a standard logic for any trigger that can be used to stop the strategy doing a set of conditions and start it back where applicable. By the way, a trigger could take any variable type : Boolean or Double or Integer or even string.

Check the attached example and focus on "Go_Long" & "Go_short" workflows.

Cheers


Attachments:
Webinar7_11.vfs [46.01 KiB]
Downloaded 156 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: i want only one position per every crossing ( ema50 and ema200) Post rating: 0   New post Posted: Mon 12 Oct, 2015, 19:27 
User avatar

User rating: 0
Joined: Wed 22 Feb, 2012, 12:24
Posts: 44
Location: Romania, Bucharest
Thanks Bro :D


 

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