BTC USD 79,899.5 Gold USD 4,349.40
Time now: Jun 1, 12:00 AM

Belajar Coding EA (mql) asas

int li_56 = MathRound(MathLog(l_ord_lots_12 / Lots) / MathLog(Multiplier)) + 1.0;

//apakah tujuan ini? Untuk cari nombor bulat?




g_lots_140 = NormalizeDouble(Lots * MathPow(Multiplier, li_56), gi_184);

// Apakah tujuan ini? NormalizeDouble untuk tukar nombor kepada double ke?


Adakah untuk money management?apakah tujuan utama nya?

Multiplier tu apa ye?
 
EA kopak, marah nanti tuan punya EA
 
contoh Aiman bagi ni memang cukup baik untuk create custom function. Kalau rajin dan saja nak syok-syok, boleh cuba modify code aiman tu jadi camni.

Code:
int init ()
{	
	// -- 
	return(0);
}

int deinit ()
{	
	Comment ("");  //-- padam comment bila remove EA daripada chart
		       //-- kalau tak letak, text comment akan kekal selepas anda remove EA
	return(0);
}

int start ()
{
	[COLOR="Red"]Comment (NamaSaya()); [/COLOR] //-- display comment pada chart (belah kiri atas)
	return(0);
}

//-- My custom function
string NamaSaya ()
{
	string myName = "Nama Saya Aiman."; //-- declare type dan letak value kepada variable 'myName'
	return (myName);                    //-- return type mesti string, myName merupakan string variable
}

Maksudnya custom function anda boleh terus jadi sebagai passing parameter...

betul 3x... :D
 
hoho..makin menarik thread nih. harap kita tak kopak ea atau indi sampai kena komen dgn tuan dia sudahla. nanti kena delete kita gak yg rugi
 
Jangan kopak EA org bang. Jom belajar sungguh-sungguh kat sini.
 
Last edited:
ades...tak bleh gak set supaya candle tukar warna kecuali secara default (dlm properties). tak pa cari cara lain plak. bukan apa, kadang-kadang terlepas setting candle tertentu. bunyi dan text bleh mengelirukan. warna adalah petunjuk terbaik kalau berkait perkara paparan di skrin.
 
lain macam je aku tgk mukadimah ea dari TT. hehe
 
ades...tak bleh gak set supaya candle tukar warna kecuali secara default (dlm properties). tak pa cari cara lain plak. bukan apa, kadang-kadang terlepas setting candle tertentu. bunyi dan text bleh mengelirukan. warna adalah petunjuk terbaik kalau berkait perkara paparan di skrin.

Code:
//+------------------------------------------------------------------+
//|                                                     myCandle.mq4 |
//|                                          Copyright © 2011, Aiman |
//|                                                                  |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2011, Aiman"
#property link      ""

#property indicator_chart_window
#property indicator_buffers 4
#property indicator_color1 DarkViolet
#property indicator_color2 DarkSlateBlue
#property indicator_color3 DarkViolet
#property indicator_color4 DarkSlateBlue

double low[],high[],open[],close[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
//---- indicators
   SetIndexStyle(0, DRAW_HISTOGRAM, STYLE_SOLID, 2);
   SetIndexBuffer(0, low);
   SetIndexStyle(1, DRAW_HISTOGRAM, STYLE_SOLID, 2);
   SetIndexBuffer(1, high);
   SetIndexStyle(2, DRAW_HISTOGRAM, STYLE_SOLID, 4);
   SetIndexBuffer(2, open);
   SetIndexStyle(3, DRAW_HISTOGRAM, STYLE_SOLID, 4);
   SetIndexBuffer(3, close);
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
//----
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
  {
   int counted_bars=IndicatorCounted();
   int newBar=Bars-counted_bars;  
   
   double O,C,H,L;
//----
   for (int i=newBar; i>-1; i--) 
   {
      O = iOpen(0,0,i);
      C = iClose(0,0,i);
      H = iHigh(0,0,i);
      L = iLow(0,0,i);
      
      //--- hammer pattern
      if(((H-L)>3*(O-C))&&((C-L)/(0.001+H-L)>0.6)&&((O-L)/(0.001+H-L)>0.6))
      {
         open[i] = O;
         close[i] = C;
         high[i] = H;
         low[i] = L;
         
         if (O>C)
         {
            high[i] = L;
            low[i] = H;
         }         
      }
      //--- 
   }
//----
   return(0);
  }
//+------------------------------------------------------------------+
 
nak belajar ea kena slow slow.
kawan kawan kalau kita OP manual.
lepas tu nak ea close.... nak buat mcm mana.
 

Live Forex Chart

Currency
Rates
EUR / USD
1.14617
USD / JPY
157.871
GBP / USD
1.33399
USD / CHF
0.82512
USD / CAD
1.40084
EUR / JPY
180.458
AUD / USD
0.71099
Back
Top
Log in Register