Dukascopy
 
 
Wiki JStore Search Login

Using MACD for closing open trade
 Post subject: Using MACD for closing open trade Post rating: 0   New post Posted: Wed 09 Mar, 2016, 05:06 
User avatar

User rating: 0
Joined: Sun 26 May, 2013, 12:18
Posts: 40
Location: India,
I have a strategy in which I use MACD to close trade when histogram is equal to 0. But close command is not executing. Where is the logic wrong?

Logic:

1. if Open position is greater than 0 (MyOpenPositions =0), then
2. if macdHist11 equals 0 (MACDLevel0 = 0), then
3. close BUY(out values Open at market buy = BUY) or close SELL (out values of Open at Market sell = SELL)



Image


Attachments:
MaSc.vfs [39.42 KiB]
Downloaded 147 times
MACD_Close_logic.jpg [95.24 KiB]
Downloaded 355 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: Using MACD for closing open trade Post rating: 0   New post Posted: Wed 09 Mar, 2016, 11:31 
Visual JForex expert at Dukascopy
User avatar

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


Attachments:
Hist_Zero.png [84.82 KiB]
Downloaded 356 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: Using MACD for closing open trade Post rating: 0   New post Posted: Wed 09 Mar, 2016, 12:13 
User avatar

User rating: 0
Joined: Sun 26 May, 2013, 12:18
Posts: 40
Location: India,
OK.
How will the logic be like if open trade is to get closed when macdhist equals or around zero line or something similar.


 
 Post subject: Re: Using MACD for closing open trade Post rating: 1   New post Posted: Wed 09 Mar, 2016, 15:16 
Visual JForex expert at Dukascopy
User avatar

User rating: 288
Joined: Thu 18 Apr, 2013, 09:26
Posts: 1496
Location: Switzerland, Geneva
Quote:
macdhist equals or around zero line or something similar


This needs to be expressed in terms of math and you'll get it !

Example
-0.000050<macdhist<+0.000050 and you express this in 2 IF blocks


 

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