النتائج 1 إلى 6 من 6
الموضوع: تصميم موشر
- 01-09-2017, 06:51 PM #1
- 05-09-2017, 07:39 PM #2
وعليكم السلام ورحمة الله وبركاته
لا يمكن تعديل شارت الميتاتريدر ليظهر فقط البارات بالشكل الذي تريده لكن إذا شرحت الفائدة من الفكره بتفصيل أكثر يمكن أن نجد حلول بديله أخي الكريم لتجربتها
- 05-09-2017, 08:11 PM #3
- 06-09-2017, 03:10 PM #4كود PHP:
#property indicator_chart_window
#property indicator_buffers 4
color Bull_Color0=clrLime;
color Bear_Color1=clrLime;
color Bull_Color2=clrLime;
color Bear_Color3=clrLime;
double High_or_Low_Buffer[];
double Low_or_High_Buffer[];
double Close_Buffer[];
double Open_Buffer[];
int OnInit()
{
ObjectsDeleteAll();
SetIndexBuffer(0,High_or_Low_Buffer);
SetIndexBuffer(1,Low_or_High_Buffer);
SetIndexBuffer(2,Close_Buffer);
SetIndexBuffer(3,Open_Buffer);
ObjectsDeleteAll();
ChartSetInteger(0,CHART_FOREGROUND,0,FALSE);
ChartSetInteger(0,CHART_COLOR_BACKGROUND,clrBlack);
ChartSetInteger(0,CHART_COLOR_CHART_LINE,ChartGetInteger(0,CHART_COLOR_BACKGROUND));
ChartSetInteger(0,CHART_MODE,CHART_LINE);
ChartSetInteger(0,CHART_SHOW_GRID,0,TRUE);
ChartSetInteger(0,CHART_SHOW_OHLC,0,TRUE);
ChartSetInteger(0,CHART_SHOW_BID_LINE,0,TRUE);
SetIndexStyle(0,DRAW_HISTOGRAM,STYLE_SOLID,1,Bull_Color0);
SetIndexStyle(1,DRAW_HISTOGRAM,STYLE_SOLID,1,Bear_Color1);
SetIndexStyle(2,DRAW_HISTOGRAM,STYLE_SOLID,5,Bull_Color2);
SetIndexStyle(3,DRAW_HISTOGRAM,STYLE_SOLID,5,Bear_Color3);
SetIndexEmptyValue(0,0.0);
SetIndexEmptyValue(1,0.0);
SetIndexEmptyValue(2,0.0);
SetIndexEmptyValue(3,0.0);
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[])
{
int BarsCount;
double Open_1,High_1,Low_1,Close_1;
int i;
RefreshRates();
ArrayInitialize(High_or_Low_Buffer,0.0);
ArrayInitialize(Low_or_High_Buffer,0.0);
ArrayInitialize(Close_Buffer,0.0);
ArrayInitialize(Open_Buffer,0.0);
BarsCount=WindowBarsPerChart()+1;
int FirstBar=WindowFirstVisibleBar();
int LastBar=FirstBar-BarsCount+1;
if(LastBar<0)
{
LastBar=0;
BarsCount=FirstBar+1;
}
/////////////////////////////
for(i=LastBar; i<LastBar+BarsCount; i++)
{
Open_1=iOpen( NULL,0,i);
Low_1=iHigh( NULL,0,i);
High_1=iLow( NULL,0,i);
Close_1=iClose( NULL,0,i);
if(Open_1<Close_1)
{
High_or_Low_Buffer[i]=High_1;
Low_or_High_Buffer[i]=Low_1;
}
else
{
High_or_Low_Buffer[i]=Low_1;
Low_or_High_Buffer[i]=High_1;
}
Close_Buffer[i]=Close_1;
Open_Buffer[i]=Close_1;
}
return(rates_total);
}
- 06-09-2017, 04:45 PM #5
- 07-09-2017, 10:26 AM #6