Kod: Zaznacz cały
if (OrderMagicNumber == magicNumber) {
// tu następuje obsługa danego zlecenia
}
Kod: Zaznacz cały
if (OrderMagicNumber == magicNumber) {
// tu następuje obsługa danego zlecenia
}
Kod: Zaznacz cały
kline = iStochastic(NULL, Period(), 20, 8, 3, MODE_SMA, 0, MODE_MAIN, 1);
dline = iStochastic(NULL, Period(), 20, 8, 3, MODE_SMA, 0, MODE_SIGNAL, 1);
shortEma = iMA(NULL,0,1,0,MODE_EMA,PRICE_CLOSE,1);
longEma = iMA(NULL,0,30,0,MODE_EMA,PRICE_CLOSE,1);
Kod: Zaznacz cały
//+------------------------------------------------------------------+
//| chuj.mq4 |
//| Copyright 2016, MetaQuotes Software Corp. |
//| https://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2016, MetaQuotes Software Corp."
#property link "https://www.mql5.com"
#property version "1.00"
#property strict
#property indicator_chart_window
#property indicator_buffers 1
#property indicator_plots 1
//--- plot Label1
#property indicator_label1 "Label1"
#property indicator_type1 DRAW_LINE
#property indicator_color1 clrRed
#property indicator_style1 STYLE_SOLID
#property indicator_width1 1
//--- input parameters
input int Input1;
//--- indicator buffers
double Label1Buffer[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int OnInit()
{
//--- indicator buffers mapping
SetIndexBuffer(0,Label1Buffer);
//---
return(INIT_SUCCEEDED);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int OnCalculate(const int rates_total,
const int prev_calculated,
const datetime &time[],
const double &open[],
const double &high[],
const double &low[],
const double &close[],
const long &tick_volume[],
const long &volume[],
const int &spread[])
{
//---
//--- return value of prev_calculated for next call
return(rates_total);
}
//+------------------------------------------------------------------+
Kod: Zaznacz cały
//+------------------------------------------------------------------+
//| mk89.mq4 |
//| Copyright 2016, MetaQuotes Software Corp. |
//| https://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2016, MetaQuotes Software Corp."
#property link "https://www.mql5.com"
#property version "1.00"
#property strict
#property indicator_separate_window
#property indicator_buffers 1
#property indicator_plots 1
//--- plot mojalinia
#property indicator_label1 "mojalinia"
#property indicator_type1 DRAW_LINE
#property indicator_color1 clrRed
#property indicator_style1 STYLE_SOLID
#property indicator_width1 1
//--- indicator buffers
double mojaliniaBuffer[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int Init()
{
//--- indicator buffers mapping
SetIndexBuffer(0,mojaliniaBuffer);
SetIndexStyle(0,DRAW_LINE);
//---
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()
{
int zliczoneBary=IndicatorCounted();
if(zliczoneBary<0)
{
return(-1);
}
int pos = Bars - zliczoneBary - 1;
double closePrice, openPrice, result;
while(pos >= 0)
{
closePrice = Close[pos];
openPrice = Open[pos];
result = closePrice - openPrice;
mojaliniaBuffer[pos]= result;
pos--;
}
return(0);
}
//+------------------------------------------------------------------+
Kod: Zaznacz cały
//+------------------------------------------------------------------+
//| jasiu.mq4 |
//| Copyright 2016, MetaQuotes Software Corp. |
//| https://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2016, MetaQuotes Software Corp."
#property link "https://www.mql5.com"
#property version "1.00"
#property strict
#property indicator_chart_window
#property indicator_buffers 1
#property indicator_plots 1
//--- plot mojalinia
#property indicator_label1 "mojalinia"
#property indicator_type1 DRAW_LINE
#property indicator_color1 clrRed
#property indicator_style1 STYLE_SOLID
#property indicator_width1 1
//--- indicator buffers
double mojaliniaBuffer[];
extern int Period_MA1 = 8;
extern int Period_MA2 = 34;
extern int Period_MA3 = 80;
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int Init()
{
//--- indicator buffers mapping
SetIndexBuffer(0,mojaliniaBuffer);
SetIndexStyle(0,DRAW_LINE);
ObjectCreate("ObjName", OBJ_LABEL, 0, 0, 0);
ObjectSetText("ObjName","Siema",14, "Verdana", Red);
ObjectSet("ObjName", OBJPROP_CORNER, 1);
ObjectSet("ObjName", OBJPROP_XDISTANCE, 20);
ObjectSet("ObjName", OBJPROP_YDISTANCE, 20);
//---
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()
{
double MA_1, MA_2, MA_3;
MA_1 = iMA(NULL,0,Period_MA1,0,MODE_SMA,PRICE_CLOSE,0);
MA_2 = iMA(NULL,0,Period_MA2,0,MODE_SMA,PRICE_CLOSE,0);
MA_3 = iMA(NULL,0,Period_MA3,0,MODE_SMA,PRICE_CLOSE,0);
if( MA_1 > MA_2 && MA_1 > MA_3 && MA_2 > MA_3)
{ ObjectSetText("ObjName","UP Trend",14, "Verdana", Red);
} else ObjectSetText("ObjName","Brak",14, "Verdana", Red);
if( MA_1 < MA_2 && MA_1 < MA_3 && MA_2 < MA_3)
{ ObjectSetText("ObjName","DOWN Trend",14, "Verdana", Red);
} else ObjectSetText("ObjName","Brak",14, "Verdana", Red);
return(0);
}
//+------------------------------------------------------------------+