Dukascopy
 
 
Wiki JStore Search Login

Simple mq4 converter Issues
 Post subject: Simple mq4 converter Issues Post rating: 0   New post Posted: Fri 20 Dec, 2013, 07:15 

User rating: 1
Joined: Wed 20 Nov, 2013, 08:51
Posts: 5
Please help me.

Simple MA Code by MQL4

#property indicator_chart_window
#property indicator_buffers 1
#property indicator_style1 STYLE_DOT
#property indicator_width1 2
#property indicator_color1 Blue

//---- input parameters
extern int MAPeriod = 20;

//---- buffers
double ma[];

//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
//---- indicators
   SetIndexStyle(0, DRAW_LINE);
   SetIndexBuffer(0, ma);
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
  {
   int    counted_bars=IndicatorCounted();
   int limit = Bars-counted_bars-1;
   for(int i=limit; i>=0; i--)
   {
      ma[i]  = iMA(NULL,0,MAPeriod,0,MODE_SMA,PRICE_CLOSE,i);
   }
   return(0);
  }
//+------------------------------------------------------------------+


have 3 issuses.

1. not STYLE_DOT
2. not width 2
3. Unnecessary line on the right side of the current Bar displays

Attachment:
ma.mt4.png [21.75 KiB]
Downloaded 200 times


 
 Post subject: Re: Simple mq4 converter Issues Post rating: 0   New post Posted: Mon 06 Jan, 2014, 10:24 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
Image

Quote:
1. not STYLE_DOT
2. not width 2

The following line sets style to LINE (with 1) instead of style DOT (width 2). Therefore to use STYLE_DOT it must be removed.
Quote:
//SetIndexStyle(0, DRAW_LINE);


Quote:
3. Unnecessary line on the right side of the current Bar displays

We were unable to reproduce this problem


Attachments:
dots.jpg [46.47 KiB]
Downloaded 293 times
Indicator_dots.mq4 [1.06 KiB]
Downloaded 88 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 mq4 converter Issues Post rating: 0   New post Posted: Tue 07 Jan, 2014, 08:51 

User rating: 1
Joined: Wed 20 Nov, 2013, 08:51
Posts: 5
Quote:
The following line sets style to LINE (with 1) instead of style DOT (width 2). Therefore to use STYLE_DOT it must be removed.


Thank you. I understood.


Quote:
Quote:
3. Unnecessary line on the right side of the current Bar displays


We were unable to reproduce this problem


This problem occurs 10 seconds , M1 , M5, M10, M15 Chart.
Please try again.


 

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