Source Code Mql4 Gabungan Beberapa Indikator
Source Code Mql4 Gabungan Beberapa Indikator
Source Code Mql4 Gabungan Beberapa Indikator
#property strict
#property indicator_chart_window
extern bool DisplayInfo=true; // display 15m, 1h, 4h and daily trend, spread and bar time
left
#include <ChartObjects\ChartObjectsLines.mqh>
int x = NULL;
CChartObjectHLine bid,ask;
//thick
int trend5mall, trend15mall, trend30mall, trend1hall, trend4hall; // trends for the EMA 35/50
int GMTbrokeroffset=0;
#define UP 0 // Trend UP
// CSM
"XAUUSD","XAGUSD"
};
double gd_112;
double gd_120;
double gd_128;
double gd_136;
double gd_144;
double gd_152;
double gd_160;
//+------------------------------------------------------------------+
//+------------------------------------------------------------------+
int OnInit()
ChartSetInteger(0,CHART_SHOW_BID_LINE,false);
ChartSetInteger(0,CHART_SHOW_ASK_LINE,false);
bid.Create(0,"__bid__",0,0.0);
bid.Color(InpBidColor);
bid.Tooltip("Bid");
if(InpShowAsk)
ask.Create(0,"__ask__",0,0.0);
ask.Color(InpAskColor);
ask.Tooltip("Ask");
//---
return(INIT_SUCCEEDED);
int deinit()
ObjectDelete(OBJ_NAME);
CleanUp();
return(0);
}
//+------------------------------------------------------------------+
//+------------------------------------------------------------------+
//-----------------------------------------
// -- spread
//-----------------------------------------
if (UseSpreadMonitor == true)
ShowSpread();
//-----------------------------------------
// -- csm
//-----------------------------------------
if (ShowCSM) displayMeter();
//-----------------------------------------
// -- thick
//-----------------------------------------
if (ShowTick == true)
int limit;
int counted_bars=IndicatorCounted();
if(counted_bars>0) counted_bars--;
limit=Bars-counted_bars;
for (int i=0; i<limit; i++) { // process all bars in the chart
if (DisplayInfo) ShowInfo();
//-----------------------------------------
// -- Profit Loss
//-----------------------------------------
if (UseProfitLossInfo == true)
int j;
int idx;
string text;
double PL;
double total;
//----
if(x != NULL) {
ObjectDelete("O"+idx);
ObjectDelete("PL"+idx);
ObjectDelete("Total1");
ObjectDelete("Total2");
text = "";
j=0;
total = 0;
if(OrderType() == OP_BUY) {
if(PL<0) DisplayText("PL"+j, "= "+DoubleToStr(PL, 0)+ " point ", Size_Font, Color_Loss, 0,
posX+129, posY+20 + j * 18, Text_Font);
else if(PL>0) DisplayText("PL"+j, "= +"+DoubleToStr(PL, 0)+ " point ", Size_Font,
Color_Profit, 0, posX+129, posY+20 + j * 18, Text_Font);
else DisplayText("PL"+j, "= "+DoubleToStr(PL, 0)+ " point ", Size_Font, Color_Text, 0,
posX+129, posY+20 + j * 18, Text_Font);
PL = (OrderOpenPrice()-OrderClosePrice())/MarketInfo(OrderSymbol(),MODE_POINT);
if(PL<0) DisplayText("PL"+j, "= "+DoubleToStr(PL, 0)+ " point " , Size_Font, Color_Loss, 0,
posX+129, posY+20 + j * 18, Text_Font);
j=j+1;
x=j;
//---
MqlTick tick;
SymbolInfoTick(_Symbol,tick);
bid.Price(0,tick.bid);
if(InpShowAsk)
ask.Price(0,tick.ask);
return(rates_total);
//+------------------------------------------------------------------+
void ShowSpread()
if(ObjectFind(OBJ_NAME) < 0)
ObjectSetText(OBJ_NAME, s);
WindowRedraw();
//-----------------------------------
void DisplayText(string objname, string text, int fontsize, color clr, double C, double X, double Y,
string font)
ObjectDelete(objname);
//-----------------------------------
void CleanUp() {
ObjectsDeleteAll(0);
void ShowInfo() {
double spread;
datetime bartimeleft;
int Y=0;
int Ya=0;
int Yb=0;
int Yc=0;
int Yd=0;
int Yall=0;
color trendcol=DimGray;
color trendcola=DimGray;
color trendcolb=DimGray;
color trendcolc=DimGray;
color trendcold=DimGray;
color trendcolall=DimGray;
string time;
if (UseBackground == true)
/*
// jam
Write("Time25", 20,100, gs_112 + " Bar end: " + li_8 + " m " + li_12 + " s ", 10, PowderBlue, "Arial
Bold");
*/
void UpdateTimes() {
localtime = TimeLocal();
brokertime = TimeCurrent();
}
void Write(string name, int x, int y, string text, int size, color col, string font="Lucida Console") {
//+------------------------------------------------------------------+
// expert CSM |
//+------------------------------------------------------------------+
int Li_16;
string Ls_28;
double Ld_36;
double Ld_44;
double Ld_ret_8 = 0;
int L_count_20 = 0;
Li_16 = 0;
Ls_28 = gsa_104[L_index_24];
if (Ld_36 != 0.0) {
L_count_20++;
Ld_ret_8 += Li_16;
Ld_ret_8 /= L_count_20;
return (Ld_ret_8);
void displayMeter() {
color L_color_0;
string L_name_12;
double Ld_4 = 0;
int L_index_32 ;
L_x_28 -= 30;
L_x_28 = 221;
Ld_4++;
L_color_0 = symcolor(currency_strength(gsa_100[L_index_32]));
L_x_28 -= 30;
int li_ret_8;
return (li_ret_8);
//+------------------------------------------------------------------+