//+------------------------------------------------------------------+
//| 1. Pengenalan EA.mq4 |
//| Copyright 2021, MetaQuotes Software Corp. |
//| https://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2021, MetaQuotes Software Corp."
#property link "https://www.mql5.com"
#property version "1.00"
#property strict
//--- input parameters
input string Komen = "EA Super Profit";
//+------------------------------------------------------------------+
//| Expert initialization function |
//+------------------------------------------------------------------+
int OnInit()
{
//---
int MinTakeProfit = 500;
int MaxStopLoss = 200;
double Lot = 0.5;
string notes = "EA Super Profit";
string info = StringConcatenate("\nAccount : ",string(AccountNumber())
,"\nNama : ",AccountInfoString(ACCOUNT_NAME)
,"\nBroker : ",AccountInfoString(ACCOUNT_COMPANY)
,"\nLeverage : 1:",AccountInfoInteger(ACCOUNT_LEVERAGE)
,"\nBalance : ",DoubleToString(AccountInfoDouble(ACCOUNT_BALANCE),2)
,"\nEquity : ",DoubleToString(AccountInfoDouble(ACCOUNT_EQUITY),2)
,"\nMargin : ",DoubleToString(AccountInfoDouble(ACCOUNT_MARGIN),2)
,"\nFree Margin : ",DoubleToString(AccountInfoDouble(ACCOUNT_MARGIN_FREE),2)
,"\nMargin Level : ",DoubleToString(AccountInfoDouble(ACCOUNT_MARGIN_LEVEL),2),"%"
,"\nBid : ",DoubleToString(SymbolInfoDouble(_Symbol,SYMBOL_BID),Digits)
,"\nAsk : ",DoubleToString(SymbolInfoDouble(_Symbol,SYMBOL_ASK),Digits)
,"\nSpread : ",IntegerToString(SymbolInfoInteger(_Symbol,SYMBOL_SPREAD))
,"\nSymbol : ",_Symbol
);
Comment(info);
//---
return(INIT_SUCCEEDED);
}
//+------------------------------------------------------------------+
//| Expert deinitialization function |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
{
//---
}
//+------------------------------------------------------------------+
//| Expert tick function |
//+------------------------------------------------------------------+
void OnTick()
{
//---
}
//+------------------------------------------------------------------+
Kalau perintah Comment memang begitu.Mau tanya Pak, saya menaruh 2 perintah Comment ( ) contoh:
Comment("Test Satu");
Comment("\nTes Dua");
tapi yang tampil adalah yang terakhir saja yaitu Test Dua
Apakah benar hanya perintah Comment( ) terakhir saja yang tampil?
Bila demikian, artinya saya perlu menggabungkan kalimat terlebih dahulu, seperti:
Comment("Test Satu"+"\nTes Dua");
Terimakasih.
Kalau perintah Comment memang begitu.
Kalau mau buat seperti yg ada dalam harapan mas maka perintahnya adalah ObjectCreate(...), itu pelajaran kedua nanti. Mungkin Jumat, atau minggu. dengan perintah ini maka kita bisa mengatur ukuran, nama font, warna, posisi, dll.
//+------------------------------------------------------------------+
//| BelajarEA.mq4 |
//| Copyright 2021, MetaQuotes Software Corp. |
//| https://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2021, MetaQuotes Software Corp."
#property link "https://www.mql5.com"
#property version "1.00"
#property strict
//+------------------------------------------------------------------+
//| Expert initialization function |
//+------------------------------------------------------------------+
int OnInit()
{
//---
string NamaEA = "Belajar EA";
//---
return(INIT_SUCCEEDED);
}
//+------------------------------------------------------------------+
//| Expert deinitialization function |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
{
//---
}
//+------------------------------------------------------------------+
//| Expert tick function |
//+------------------------------------------------------------------+
void OnTick()
{
//---
string info = StringConcatenate("\nNAMA : ",AccountInfoString(ACCOUNT_NAME)
,"\nACCOUNT : ",string(AccountNumber())
,"\nBROKER : ",AccountInfoString(ACCOUNT_COMPANY)
,"\nLEVERAGE : 1:",AccountInfoInteger(ACCOUNT_LEVERAGE)
,"\nBALANCE : ",DoubleToString(AccountInfoDouble(ACCOUNT_BALANCE),2)
,"\nEQUITY : ",DoubleToString(AccountInfoDouble(ACCOUNT_EQUITY),2)
,"\nMARGIN : ",DoubleToString(AccountInfoDouble(ACCOUNT_MARGIN),2)
,"\nFREE MARGIN : ",DoubleToString(AccountInfoDouble(ACCOUNT_MARGIN_FREE),2)
,"\nMARGIN LEVEL : ",DoubleToString(AccountInfoDouble(ACCOUNT_MARGIN_LEVEL),2),"%"
,"\nBID : ",DoubleToString(SymbolInfoDouble(_Symbol,SYMBOL_BID),Digits)
,"\nASK : ",DoubleToString(SymbolInfoDouble(_Symbol,SYMBOL_ASK),Digits)
,"\nSPREAD : ",IntegerToString(SymbolInfoInteger(_Symbol,SYMBOL_SPREAD))
,"\nSYMBOL : ",_Symbol
);
Comment(info);
}
//+------------------------------------------------------------------+
//+------------------------------------------------------------------+
//| 2. OrderSend & Tulisan.mq4 |
//| Copyright 2021, Soe Hoe |
//| https://www.soehoe.id |
//+------------------------------------------------------------------+
#property copyright "Copyright 2021, Soe Hoe"
#property link "https://www.soehoe.id"
#property version "1.00"
#property strict
string Komen = "Takkan LOSS";
string objName = "soehoe";
double BalanceAwal = 1000;
//+------------------------------------------------------------------+
//| Expert initialization function |
//+------------------------------------------------------------------+
int OnInit()
{
//---
ObjectsDeleteAll(0);
int MinTakeProfit = 500;
int MaxStopLoss = 200;
double Lot = 0.10;
int row=1;
int col=1;
color cBalance = clrAqua;
if( AccountBalance()< (BalanceAwal*0.3) ) cBalance=clrRed;
//<, >, <=, >=, ==, !=
QnText(row,"Equity"); QnText(row, DoubleToString( AccountEquity(),2),col,clrAntiqueWhite); row++;
QnText(row,"Balance"); QnText(row,DoubleToString(AccountBalance(),2),col,cBalance); row++;
QnText(row,"Profit"); QnText(row, DoubleToString(AccountProfit(),2),col,clrBeige); row++;
//---
return(INIT_SUCCEEDED);
}
//====================================================================
void QnText(int myList, string myText, int myCol=0,color myColor = clrYellowGreen){
string myName = StringConcatenate(objName,myList,myCol);
int myY = 45*myList;
int myX = 220*myCol+20;
int chart_ID =0;
ObjectCreate(chart_ID,myName,OBJ_LABEL,0,0,0); //Alert("test");
ObjectSetInteger(chart_ID,myName,OBJPROP_COLOR,myColor);
ObjectSetInteger(chart_ID,myName,OBJPROP_XDISTANCE,myX);
ObjectSetInteger(chart_ID,myName,OBJPROP_YDISTANCE,myY);
ObjectSetInteger(chart_ID,myName,OBJPROP_FONTSIZE,17);
ObjectSetInteger(chart_ID,myName,OBJPROP_CORNER,CORNER_LEFT_UPPER);
ObjectSetString(chart_ID,myName,OBJPROP_TEXT,myText);
ObjectSetString(chart_ID,myName,OBJPROP_FONT,"Verdana");
WindowRedraw();
}
//====================================================================
//====================================================================
//+------------------------------------------------------------------+
//| Expert deinitialization function |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
{
//---
}
//+------------------------------------------------------------------+
//| Expert tick function |
//+------------------------------------------------------------------+
void OnTick()
{
//---
}
//+------------------------------------------------------------------+
belum ada om, untuk tanya jawab kita fokuskan di forum iniSebelumnya, sy terima kasih om Soehoe udah mau luangkan waktu untuk mengajar cara membuat EA dari dasar, apakah untuk pembelajaran online tnya jawab, selain melalui zoom n forum ini apakah ada spt group chat wa/tele? trims
//+------------------------------------------------------------------+
//| Belajar EA1.mq4 |
//| Copyright 2021, Mokodesk |
//| https://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2021, Mokodesk"
#property link "https://www.mql5.com"
#property version "1.00"
#property strict
//+------------------------------------------------------------------+
//| Expert initialization function |
//+------------------------------------------------------------------+
int OnInit()
{
//---
string NamaEA = "Belajar EA1";
//---
return(INIT_SUCCEEDED);
}
//+-------------------------------------------------st-----------------+
//| Expert deinitialization function |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
{
//---
}
//+------------------------------------------------------------------+
//| Expert tick function |
//+------------------------------------------------------------------+
void OnTick()
{
//---
string info = StringConcatenate("\nNAMA :",AccountInfoString(ACCOUNT_NAME)
,"\nACCOUNT :",string(AccountNumber())
,"\nBROKER : ",AccountInfoString(ACCOUNT_COMPANY)
,"\nLEVERAGE :1:",AccountInfoInteger(ACCOUNT_LEVERAGE)
,"\nBALANCE : ", DoubleToString(AccountInfoDouble(ACCOUNT_BALANCE),2)
,"\nEQUITY : ",DoubleToString(AccountInfoDouble(ACCOUNT_EQUITY),2)
,"\nMARGIN : ",DoubleToString(AccountInfoDouble(ACCOUNT_MARGIN),2)
,"\nFREE MARGIN : ",DoubleToString(AccountInfoDouble(ACCOUNT_MARGIN_FREE),2)
,"\nMARGIN LEVEL : ",DoubleToString(AccountInfoDouble(ACCOUNT_MARGIN_LEVEL),2),"%"
,"\nBID : ",DoubleToString(SymbolInfoDouble(_Symbol,SYMBOL_BID),Digits)
,"\nASK : ", DoubleToString(SymbolInfoDouble(_Symbol,SYMBOL_ASK),Digits)
,"\nSPREAD : ", IntegerToString(SymbolInfoInteger(_Symbol,SYMBOL_SPREAD))
,"\nSYMBOL : ",_Symbol);
Comment(info);
}
//+------------------------------------------------------------------+