Dukascopy
 
 
Wiki JStore Search Login

DTOSC Indicator conversion issue
 Post subject: DTOSC Indicator conversion issue Post rating: 0   New post Posted: Mon 09 Dec, 2013, 21:01 

User rating: 1
Joined: Mon 02 Dec, 2013, 11:32
Posts: 27
Location: AustraliaAustralia
Hi guys,

I have tried to load a couple of my indicators from MT4 which are crucial to my Live strategies, so I need to make sure these work on your platform before I can start to rewrite my strategies. Naturally without these indicators working anyway there is no chance of trying to convert my mt4 strategy.

First the DTOSC indicator - there are 4 verisions. DTOSC 5 / DTOSC 8 / DTOSC 13 / DTOSC 21 I have compiled them and they seem to compile ok, but when I add them to a chart there is only one line instead of two in the indicator window and both values are the same for 0 and 1. They should be different - essentially there is a fast and a slow line.
I think the issue may be related to the use of iMAOnArray for the SD and SK values.
If I just change the setting in the indicator for for SD and SK I then get two lines and two values. But they are actually a moving average of the array values.
I have copied the iMAOnArray function details from MT4 for you below. Can you cater for this?


Is there a way for me to see how jforex has converted the code into the jfx file - ie can I somehow convert this back to a .java file? As at the moment the only way to see the code is as the mq4 files.

Second, I have a SCS_Swings indicator which is very similar to the ZigZag indicator, but instead of input variables Depth/Deviation/Backstep I can select Minimum bars and then either a Minimum No of points per swing or a minimum percentage. It seems to compile ok, but then nothing appears on the chart, and I then start to get other error messages.
Is there anyway to see the code for the ZigZag indicator?



Also in the indicator setting what do the following mean (I can't find this in the wiki or help)
Tooltip,
Value,
Recalculate on new candle
Then all the references to Connector eg Connector lookback, Connector shift etc



Thanks

Simon


double iMAOnArray( double array[], int total, int period, int ma_shift, int ma_method, int shift) Calculation of the Moving Average on data stored in a numeric array. Unlike iMA(...), the iMAOnArray function does not take data by symbol name, timeframe, the applied price. The price data must be previously prepared. The indicator is calculated from left to right. To access to the array elements as to a series array (i.e., from right to left), one has to use the ArraySetAsSeries function.
Parameters:
array[] - Array with data.
total - The number of items to be counted. 0 means whole array.
period - Averaging period for calculation.
ma_shift - MA shift
ma_method - MA method. It can be any of the Moving Average method enumeration value.
shift - Index of the value taken from the indicator buffer (shift relative to the current bar the given amount of periods ago).

Sample:
double macurrent=iMAOnArray(ExtBuffer,0,5,0,MODE_LWMA,0);
double macurrentslow=iMAOnArray(ExtBuffer,0,10,0,MODE_LWMA,0);
double maprev=iMAOnArray(ExtBuffer,0,5,0,MODE_LWMA,1);
double maprevslow=iMAOnArray(ExtBuffer,0,10,0,MODE_LWMA,1);
//----
if(maprev<maprevslow && macurrent>=macurrentslow)
Alert("crossing up");


Attachments:
SCS_Swings.mq4 [6.63 KiB]
Downloaded 144 times
DTOSC 21.mq4 [2.27 KiB]
Downloaded 132 times
DTOSC 13.mq4 [2.26 KiB]
Downloaded 143 times
DTOSC 8.mq4 [2.26 KiB]
Downloaded 134 times
DTOSC 5.mq4 [2.26 KiB]
Downloaded 147 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: DTOSC Indicator conversion issue Post rating: 0   New post Posted: Mon 16 Dec, 2013, 12:36 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
To fix DTOSC please replace the following code
#property indicator_buffers 2

with:
#property indicator_buffers 4


And here is modified SCS_Swings:


Attachments:
SCS_Swings (1).mq4 [6.67 KiB]
Downloaded 129 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: DTOSC Indicator conversion issue Post rating: 0   New post Posted: Tue 17 Dec, 2013, 06:02 

User rating: 1
Joined: Mon 02 Dec, 2013, 11:32
Posts: 27
Location: AustraliaAustralia
Thank you support :D

I have loaded these onto my demo account and compared back to my MT4 ECN. (I appreciate their will be slight pricing differences, but as you can see from the chart examples they are fairly close so I would expect a close resemblance between the two for the indicators.)

There seem to be some differences.

On the DTOSC - I am not sure why I needed 4 buffers - I only need 2 values? (Essentially a fast and slow line). However none of the values seem to marry up to my MT4 platform. This can be seen from the screen shot comparisons.

On the Swings indicator, it seems to be quite close, until i try changing the settings.
I should be able to adjust Minbar and MinPoints (leaving minpercent=0) or Minbar and MinPercent (leaving Minpoints=0) and the swing shape should change accordingly. It does to a degree but if i drop it down to lower settings eg minbar=1 and minpoints=30 (as per screenshot) Jforex doesn't seem to change to pick up all the smaller swings.

please could you take another look?
thanks for your help so far...
Image
Image


Attachments:
Chart_EUR_USD_Hourly_snapshot jforex.png [16.66 KiB]
Downloaded 505 times
MT4_eurusdh1.png [40.01 KiB]
Downloaded 439 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: DTOSC Indicator conversion issue Post rating: 0   New post Posted: Wed 18 Dec, 2013, 16:43 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
This issue is fixed now and it will be available with the next DEMO release.


 
 Post subject: Re: DTOSC Indicator conversion issue Post rating: 0   New post Posted: Wed 18 Dec, 2013, 23:16 

User rating: 1
Joined: Mon 02 Dec, 2013, 11:32
Posts: 27
Location: AustraliaAustralia
thanks support - is that in reference to the issue with the DTOSC or the Swings indicator, or hopefully both?
when is the next release due?


 
 Post subject: Re: DTOSC Indicator conversion issue Post rating: 0   New post Posted: Fri 03 Jan, 2014, 10:25 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
The release is scheduled next week.


 

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