Dukascopy
 
 
Wiki JStore Search Login

simple MACD strategie
 Post subject: simple MACD strategie Post rating: 0   New post Posted: Tue 28 May, 2013, 18:35 
User avatar

User rating: 0
Joined: Tue 04 Oct, 2011, 17:34
Posts: 2
Location: SwitzerlandSwitzerland
did anyone build already a simple MACD strategie? Iam new to this and don't fully understand all this terms yet and the logic how to build, but if i see one i could make better relation to it.
I have seen the possibility to export the Visual Jforex strategie to the jForex platform, but is it also possible to import the coding of an existing strategie writen in Jforex to Visual Jforex?


 
 Post subject: Re: simple MACD strategie Post rating: 0   New post Posted: Thu 30 May, 2013, 11:40 
Visual JForex expert at Dukascopy
User avatar

User rating: 27
Joined: Fri 03 May, 2013, 18:25
Posts: 366
Location: GermanyGermany
Hello JackP,

regarding to your last question, it is not possible yet to use a coded strategy and implement it into VJF.

As you mentioned that you are quite new to Visual JForex I recommend to have a closer look at the video tutorials https://www.youtube.com/watch?v=7cElEilgA1Q and on our website https://www.dukascopy.com/swiss/english/ ... tutorials/.

If you have questions regarding to different strategies just post it here with additional informations of what your planning to program, so that the community can give you answers.


Dirk


 
 Post subject: Re: simple MACD strategie Post rating: 0   New post Posted: Sat 01 Jun, 2013, 15:01 
User avatar

User rating: 0
Joined: Tue 04 Oct, 2011, 17:34
Posts: 2
Location: SwitzerlandSwitzerland
thank you for the reply, I watched already all the tutorial videos but unfortunately its not sufficient information to start coding a strategy for beginners.
I would like to have a MACD strategy it should sell or buy. Whenever the Fast Period (12) is crossing the Signal Period (9) from above ---> sell,
and whenever its crossing from below -----> buy
is anybody able to do it?


 
 Post subject: Re: simple MACD strategie Post rating: 1   New post Posted: Sun 02 Jun, 2013, 02:57 
User avatar

User rating: 7
Joined: Wed 04 Jul, 2012, 02:40
Posts: 109
Location: Australia, Melbourne
Hello Jack,

Ok I have built something that does what you ask and I have tested it ok for you.

Regarding the MACD - you have asked for the cross of a fast period (12) across the signal period (9). I have to assume you mean the MACD line (as the fast period is not shown in the macd.). The macd line is actually a formula which is (12 EMA - 26 EMA).

More info on MACD here:
https://stockcharts.com/school/doku.php? ... rage_conve

SO to build your idea - we need to think about what data we need. To show a cross we do have to look at 2 bars - the bar before the cross and the bar after. So a cross is PREVIOUS MACD line less than signal line, and CURRENT BAR MACD line above the signal line.

The example I have built will do that.
Now as the rest of your idea - currently you have an ENTRY... You also need: Stoploss / Exit Strategy / Position Sizing and some other considerations as to how many positions open at once. I have put a take profit and a stoploss in for you, but this is not the best way to run a trading system. On top of that we are using a fixed postion size (set a 0.001). Better to use a dynamic position sizing algo like fixed factional position sizing.

The picture shows the system working

In my vjf file I have limited the amount of positions to one.

If you have any questions - or need any more help, Let me know.

DoC


Attachments:
macdjacp.vfs [27.46 KiB]
Downloaded 434 times
Capture.JPG [98.77 KiB]
Downloaded 443 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: simple MACD strategie Post rating: 1   New post Posted: Sun 02 Jun, 2013, 23:10 
User avatar

User rating: 7
Joined: Wed 04 Jul, 2012, 02:40
Posts: 109
Location: Australia, Melbourne
Quote:
I thought about whenever the strategy hits the SL it should open up an order going into direction the course (opposite direction of the previous order) is also going until it hits again the SL or TP (values of SL and TP don't matter for now)


Ok Jack - so i've added in the improvement you requested. I have tested it and it is working. The only issue I can see is that when the SL is hit it then reverses the position, if the SL if hit again it reverses the position again. I dont know if you want this to happen - it might actually work well, I would however make sure your take profit is bigger than your stoploss (i.e 30 tp / 10 sl). Probably work better with this kind of system.

Enjoy,

DoC


Attachments:
macdjacp.vfs [38.52 KiB]
Downloaded 390 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: simple MACD strategie Post rating: 0   New post Posted: Sun 22 Sep, 2013, 17:40 
User avatar

User rating: 0
Joined: Fri 14 Jun, 2013, 21:26
Posts: 35
Location: Italy, Turin
sorry for the necropost

Image

shall you help me doczero with this bug? I can't fix it, please see this post =) viewtopic.php?f=139&t=50001


 

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