Dukascopy
 
 
Wiki JStore Search Login

How to Check If it’s Been Less Than 60 Days (2 Months since SMA Turned)
 Post subject: How to Check If it’s Been Less Than 60 Days (2 Months since SMA Turned) Post rating: 0   New post Posted: Mon 08 Jun, 2015, 09:12 
User avatar

User rating: 2
Joined: Sat 07 Feb, 2015, 06:45
Posts: 21
Location: Kenya, Nairobi
I am getting confused over this. I want to check if it has been less than 60 days since the 8-day SMA turned up or down. Do I create 3 monthly SMA blocks with shift 0, 1, 2 then compare the output to daily 8-day SMA?

Any help is greatly appreciated

Regards


 
 Post subject: Re: How to Check If it’s Been Less Than 60 Days (2 Months since SMA Turned) Post rating: 0   New post Posted: Thu 16 Jul, 2015, 16:43 
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 late reply;

Your request is much more complicated than that but it is possible to be made:
You have to start with working on daily basis then implement a counter that counts the days till 8. Afterward, you should retrieve the Open High low and close prices from the data collected.
I can build an example for you if you're still interested in this idea

Cheers


 
 Post subject: Re: How to Check If it’s Been Less Than 60 Days (2 Months since SMA Turned) Post rating: 0   New post Posted: Thu 16 Jul, 2015, 17:08 
User avatar

User rating: 2
Joined: Sat 07 Feb, 2015, 06:45
Posts: 21
Location: Kenya, Nairobi
Hello amine_chourou,

Thank you for replying.
An example would be very helpful as I am stuck at this point :-) Thanks again for your assistance.

Regards


 
 Post subject: Re: How to Check If it’s Been Less Than 60 Days (2 Months since SMA Turned) Post rating: 0   New post Posted: Fri 17 Jul, 2015, 12:31 
Visual JForex expert at Dukascopy
User avatar

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

I made a example based on 6 days :
- The period filter is quite important to be able to trade on daily basis as you can see
- The SMA is built on 1 day period and a counter is incrementing till 6 --> 6 days
- Once the counter reaches 6, the simple average is calculated: in this example I took the total sum of 6 daily SMA divided by 6
- the assign blocks are used to reset the counter and the sum variable otherwise they will keep increasing indefinitely

Cheers


Attachments:
SMA6Days.vfs [26.88 KiB]
Downloaded 92 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: How to Check If it’s Been Less Than 60 Days (2 Months since SMA Turned) Post rating: 0   New post Posted: Mon 27 Jul, 2015, 11:20 
User avatar

User rating: 2
Joined: Sat 07 Feb, 2015, 06:45
Posts: 21
Location: Kenya, Nairobi
Thank you so much for this. I am still figuring out how to incorporate it into my initial idea.


 
The Best Answer  Post subject: Re: How to Check If it’s Been Less Than 60 Days (2 Months since SMA Turned) Post rating: 0   New post Posted: Thu 06 Aug, 2015, 17:25 
Visual JForex expert at Dukascopy
User avatar

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

How do you define the following:
Quote:
since the 8-day SMA turned up or down


will you simply compare the current 8days SMA with the previous one to determine the trend or you need more "shifted data" for that ?
As the strategy will build 8 days EMAs, the trend identification will be based on 8 bars of 8 days (which makes 64 days) so in other words first the strategy compute the SMAs every 8 daily candles then store the current value and compare it to the previous one to determine the trend. Is this fine for you ?

Cheers


 
 Post subject: Re: How to Check If it’s Been Less Than 60 Days (2 Months since SMA Turned) Post rating: 0   New post Posted: Thu 20 Aug, 2015, 16:01 
User avatar

User rating: 2
Joined: Sat 07 Feb, 2015, 06:45
Posts: 21
Location: Kenya, Nairobi
Hello,
This works better that I expected thanks. I really appreciate your time.


 

Jump to:  

  © 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