Dukascopy
 
 
Wiki JStore Search Login

How to adjust two counters with different candle periods?
 Post subject: How to adjust two counters with different candle periods? Post rating: 0   New post Posted: Thu 25 Feb, 2016, 16:38 
User avatar

User rating: 1
Joined: Wed 30 Jul, 2014, 14:33
Posts: 95
Location: Lithuania, Vilnius
I am trying to adjust two counters with different candle periods and to run them simultaneously. One counter has 4 Hours candle period and the other one 1 Hour candle period. 1 Hour period counter works perfectly, and it opens positions as is determined in the sample attached (see attachment), i.e. a position was opened if macdHist1 was above (below) the zero for one hour. According to the logic placed in the sample attached the ensuing alerts (after 2 hours, 3 hours, 4 hours, 5 hours etc.) were eliminated. The problem occurs when I added a 4 Hours candle period counter. According to the logic, a position has to be opened if macdHist2 was above (below) the zero for four hours and after 24 hours all ensuing alerts have to be eliminated. Unfortunately, 4 Hours candle period counter does not work properly. It opens positions randomly (in spite the macdHist2 is above or below the zero).

Could you please help me to adjust these two counters, in case to have them working simultaneously according to the logic given above?

Thank you in advance.


Attachments:
test11.vfs [62.92 KiB]
Downloaded 179 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 adjust two counters with different candle periods? Post rating: 0   New post Posted: Fri 26 Feb, 2016, 10:46 
Visual JForex expert at Dukascopy
User avatar

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

I've included some comments straight in your file.

Cheers


Attachments:
test11_commented.vfs [61.72 KiB]
Downloaded 191 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 adjust two counters with different candle periods? Post rating: 0   New post Posted: Fri 26 Feb, 2016, 20:50 
User avatar

User rating: 1
Joined: Wed 30 Jul, 2014, 14:33
Posts: 95
Location: Lithuania, Vilnius
amine_chourou wrote:
Hi,

I've included some comments straight in your file.

Cheers

Thank you for the prompt answer. Unfortunately, I am not a programmer, and I don't know how to change the Assigned Value of 4 Hours candle period counter you have pointed to in case to have these two counters working properly.

Would you be so kind to help me with that?

Thank you.


 
 Post subject: Re: How to adjust two counters with different candle periods? Post rating: 0   New post Posted: Mon 29 Feb, 2016, 11:59 
Visual JForex expert at Dukascopy
User avatar

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

I'm not programmer too :D
Actually I did not point any 4 hours candle period in my comments but rather the "Assign" block that reset the counter from the issue arise. If you want your counters to keep on going you have to delete this reset to 0 if counter is greater than 1.

Cheers


 
 Post subject: Re: How to adjust two counters with different candle periods? Post rating: 0   New post Posted: Mon 29 Feb, 2016, 14:11 
User avatar

User rating: 1
Joined: Wed 30 Jul, 2014, 14:33
Posts: 95
Location: Lithuania, Vilnius
amine_chourou wrote:
Hi,

I'm not programmer too :D
Actually I did not point any 4 hours candle period in my comments but rather the "Assign" block that reset the counter from the issue arise. If you want your counters to keep on going you have to delete this reset to 0 if counter is greater than 1.

Cheers

Thanks a lot for your explanation. I'll try.


 
 Post subject: Re: How to adjust two counters with different candle periods? Post rating: 0   New post Posted: Thu 03 Mar, 2016, 16:39 
User avatar

User rating: 1
Joined: Wed 30 Jul, 2014, 14:33
Posts: 95
Location: Lithuania, Vilnius
Hi,
I did what you said. I changed the "Assign" block and 4 Hours period counter is working now (see attachment). Unfortunately, the system keeps opening orders randomly. I need to have an order opened just in case the macdHist on both counters (4Hours and 1Hour) are above/below the zero. Could you please help me with that?
Thank you.


Attachments:
test11.vfs [56.99 KiB]
Downloaded 183 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 adjust two counters with different candle periods? Post rating: 0   New post Posted: Thu 03 Mar, 2016, 17:37 
Visual JForex expert at Dukascopy
User avatar

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

To be honest, I'm lost in the jungle :D
Why such use of several counters and Boolean variables ?
can you please start from scratch the main idea of your strategy ? I do understand that you want to trade on 2 periods, 4h and 1h. and then ? what are the entry / exit conditions with regards to the indicator ? Any position limitation to be handled ?
Please describe thoroughly in bullet points if you can (and not in a plain paragraph) and I'll do my best to help you

Thanks in advance


 
 Post subject: Re: How to adjust two counters with different candle periods? Post rating: 0   New post Posted: Fri 04 Mar, 2016, 15:40 
User avatar

User rating: 1
Joined: Wed 30 Jul, 2014, 14:33
Posts: 95
Location: Lithuania, Vilnius
amine_chourou wrote:
Hi,

To be honest, I'm lost in the jungle :D
Why such use of several counters and Boolean variables ?
can you please start from scratch the main idea of your strategy ? I do understand that you want to trade on 2 periods, 4h and 1h. and then ? what are the entry / exit conditions with regards to the indicator ? Any position limitation to be handled ?
Please describe thoroughly in bullet points if you can (and not in a plain paragraph) and I'll do my best to help you

Thanks in advance

Thank you for the answer. As you already mentioned above I wanted to trade on 2 periods, 4h and 1h, that's right. The main idea of my strategy is to have a position opened, if the macdHisto on both MACD indicators (with periods of 4h and 1h) is above/below the zero. So, the entry condition with regards to the indicators I already expressed in the main idea of my strategy. There are no extra conditions. I don't need any additional position limitation, except the one is already implemented in my strategy. I do hope I described my strategy in the bullet points (see attachment).
If you have any questions please let me know.
Thank you.


Attachments:
test12.vfs [58.83 KiB]
Downloaded 153 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 adjust two counters with different candle periods? Post rating: 0   New post Posted: Thu 21 Apr, 2016, 18:04 
User avatar

User rating: 1
Joined: Wed 30 Jul, 2014, 14:33
Posts: 95
Location: Lithuania, Vilnius
Please, could anybody help me to adjust these two counters (see attachment).
Thanks in advance.


 
 Post subject: Re: How to adjust two counters with different candle periods? Post rating: 0   New post Posted: Mon 25 Apr, 2016, 16:00 
Visual JForex expert at Dukascopy
User avatar

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

As I was unable to understand the goal of such multiple counters, and based on the following statement:
Quote:
The main idea of my strategy is to have a position opened, if the macdHisto on both MACD indicators (with periods of 4h and 1h) is above/below the zero


You can implement a variable that takes either value 1 or 2 based on the MACDhisto 1h and 4h outputs and these variables will get reset'd to 0 once a position is submitted for example.
Please review the attached and modify it as per your convenience.

Thanks


Attachments:
test11_SAMPLE.vfs [39.82 KiB]
Downloaded 177 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 adjust two counters with different candle periods? Post rating: 0   New post Posted: Wed 27 Apr, 2016, 12:15 
User avatar

User rating: 1
Joined: Wed 30 Jul, 2014, 14:33
Posts: 95
Location: Lithuania, Vilnius
Thank you anyway.


 

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