Kenapa harus PM jika thraed ini adalah belajar Mql4 sampai mahir, artinya semua di share dan di diskusikan di sini gan.. bukan PMPM saya gan
___Sekarang bagaimana menterjemahkan dalam bahasa MQL agar bisa dipake di dalam EA
Code://+------------------------------------------------------------------+ //| Price Action.mq4 | //| ngasqus | //| https://soehoe.com | //+------------------------------------------------------------------+ #property copyright "ngasqus" #property link "https://soehoe.com" #property version "1.00" #property strict //+------------------------------------------------------------------+ //| Expert initialization function | //+------------------------------------------------------------------+ int OnInit() { //--- //--- return(INIT_SUCCEEDED); } //+------------------------------------------------------------------+ //| Expert deinitialization function | //+------------------------------------------------------------------+ void OnDeinit(const int reason) { //--- } //+------------------------------------------------------------------+ //| Expert tick function | //+------------------------------------------------------------------+ void OnTick() { //--- } //+------------------------------------------------------------------+
yang di atas adalah EA kosong masih belum di apa-apain, belum di isi dengan strategi price action
Kita perlu definisikan candle di dalam setelah candle ditutup untuk itu diperlukan variable baru untuk menetapkan nilai-nilai mereka ntar jadinya seperti ini :
Code://+------------------------------------------------------------------+ //| Price Action.mq4 | //| ngasqus | //| https://soehoe.com | //+------------------------------------------------------------------+ #property copyright "ngasqus" #property link "https://soehoe.com" #property version "1.00" #property strict double open1,//candle pertama Open price open2, //candle kedua Open price close1, //candle pertama Close price close2, //candle kedua Close price low1, //candle pertama Low price low2, //candle kedua Low price high1, //candle pertama High price high2; //candle kedua High price //+------------------------------------------------------------------+ //| Expert initialization function | //+------------------------------------------------------------------+ int OnInit() { //--- //--- return(INIT_SUCCEEDED); } //+------------------------------------------------------------------+ //| Expert deinitialization function | //+------------------------------------------------------------------+ void OnDeinit(const int reason) { //--- } //+------------------------------------------------------------------+ //| Expert tick function | //+------------------------------------------------------------------+ void OnTick() { //-Menentukan harga dari candle yang diperlukan- open1 = NormalizeDouble(iOpen(Symbol(), Period(), 1), Digits); open2 = NormalizeDouble(iOpen(Symbol(), Period(), 2), Digits); close1 = NormalizeDouble(iClose(Symbol(), Period(), 1), Digits); close2 = NormalizeDouble(iClose(Symbol(), Period(), 2), Digits); low1 = NormalizeDouble(iLow(Symbol(), Period(), 1), Digits); low2 = NormalizeDouble(iLow(Symbol(), Period(), 2), Digits); high1 = NormalizeDouble(iHigh(Symbol(), Period(), 1), Digits); high2 = NormalizeDouble(iHigh(Symbol(), Period(), 2), Digits); } //+------------------------------------------------------------------+
sebagai contoh, jika candle pertama bearish (candle 2) sedangkan inside barnya bullish (candle 1) mari ditambahkan ke dalam kode fungsi OnTick
Code:if(open2>close2 && //candle ke 2 is bullish close1>open1 && //candle is bearish high2>high1 && //the bar 2 High exceeds the first one's High open2>close1 && //the second bar's Open exceeds the first bar's Close low2<low1) //the second bar's Low is lower than the first bar's Low
O iya belum ditambahkan variable lainnya
Code:extern int interval = 20; //Interval extern double lot = 0.1; //Lot Size extern int TP = 300; //Take Profit extern int magic = 555124; //Magic number extern int slippage = 2; //Slippage extern int ExpDate = 48; //Expiration Hour Order extern int bar2size = 800; //Bar 2 Size
Mantap, ijin sedot...salam...
ini saya COPAS dari sebuah artikel teman trader kita pada blognya..
jujur saja ni ya, sudah berapa kali saya membaca artikel ini tapi belum juga bisa menciptakan sebuah EA, pasti ada saja ERRORnya..
saya buat Thread ini berharap ada para masta masti share script2 jitu nya di sini, hehehe..
salam trader..
![]()