أستاذ وضاح أو أي أحد من الإخوان
محتاج مؤشر البايفت اليومي،والأسبوعي،والشهري،لو تكرمتم
وتقبلوا فائق إحترامي وتقديري
Printable View
أستاذ وضاح أو أي أحد من الإخوان
محتاج مؤشر البايفت اليومي،والأسبوعي،والشهري،لو تكرمتم
وتقبلوا فائق إحترامي وتقديري
أهلا بك أخي
هذا كود المؤشر للبايفوت اليومي :
كود PHP:
#property copyright "Copyright © 2007, Waddah Attar"
#property link "[email protected]"
//----
#property indicator_chart_window
#property indicator_buffers 1
#property indicator_color1 Blue
//---- buffers
double P1Buffer[];
//----
int myPeriod = PERIOD_D1;
//----
double PP;
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
SetIndexBuffer(0, P1Buffer);
//----
SetIndexStyle(0, DRAW_LINE, STYLE_SOLID, 2);
//----
Comment("By eng.Waddah Attar");
return(0);
}
//+------------------------------------------------------------------+
//| Custor indicator deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
ObjectDelete("DayP");
Comment("");
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()
{
int i, dayi, counted_bars = IndicatorCounted();
//---- check for possible errors
if(counted_bars < 0)
return(-1);
//---- last counted bar will be recounted
if(counted_bars > 0)
counted_bars--;
int limit = Bars - counted_bars;
//----
for(i = limit - 1; i >= 0; i--)
{
dayi = iBarShift(Symbol(), myPeriod, Time[i], false);
PP = (iHigh(Symbol(), myPeriod, dayi + 1) +
iLow(Symbol(), myPeriod, dayi + 1) +
iClose(Symbol(), myPeriod, dayi + 1)) / 3;
//----
P1Buffer[i] = PP;
SetPrice("DayP", Time[i], PP, Blue);
SetText("txtDayP", "DayP", Time[i], PP, Blue);
}
//----
return(0);
}
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
void SetPrice(string name, datetime Tm, double Prc, color clr)
{
if(ObjectFind(name) == -1)
{
ObjectCreate(name, OBJ_ARROW, 0, Tm, Prc);
ObjectSet(name, OBJPROP_COLOR, clr);
ObjectSet(name, OBJPROP_WIDTH, 1);
ObjectSet(name, OBJPROP_ARROWCODE, SYMBOL_RIGHTPRICE);
}
else
{
ObjectSet(name, OBJPROP_TIME1, Tm);
ObjectSet(name, OBJPROP_PRICE1, Prc);
ObjectSet(name, OBJPROP_COLOR, clr);
ObjectSet(name, OBJPROP_WIDTH, 1);
ObjectSet(name, OBJPROP_ARROWCODE, SYMBOL_RIGHTPRICE);
}
}
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
void SetText(string name, string txt, datetime Tm, double Prc, color clr)
{
if(ObjectFind(name) == -1)
{
ObjectCreate(name, OBJ_TEXT, 0, Tm, Prc);
ObjectSetText(name, txt, 10, "Times New Roman", clr);
ObjectSet(name, OBJPROP_CORNER, 2);
}
else
{
ObjectSet(name, OBJPROP_TIME1, Tm);
ObjectSet(name, OBJPROP_PRICE1, Prc);
ObjectSetText(name, txt, 10, "Times New Roman", clr);
ObjectSet(name, OBJPROP_CORNER, 2);
}
}
//+------------------------------------------------------------------+
وهذا كود المؤشر للبايفوت الأسبوعي :
كود PHP:
#property copyright "Copyright © 2007, Waddah Attar"
#property link "[email protected]"
//----
#property indicator_chart_window
#property indicator_buffers 1
#property indicator_color1 Blue
//---- buffers
double P1Buffer[];
//----
int myPeriod = PERIOD_W1;
//----
double PP;
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
SetIndexBuffer(0, P1Buffer);
//----
SetIndexStyle(0, DRAW_LINE, STYLE_SOLID, 2);
//----
Comment("By eng.Waddah Attar");
return(0);
}
//+------------------------------------------------------------------+
//| Custor indicator deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
ObjectDelete("WeekP");
Comment("");
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()
{
int i, dayi, counted_bars = IndicatorCounted();
//---- check for possible errors
if(counted_bars < 0)
return(-1);
//---- last counted bar will be recounted
if(counted_bars > 0)
counted_bars--;
int limit = Bars - counted_bars;
//----
for(i = limit - 1; i >= 0; i--)
{
dayi = iBarShift(Symbol(), myPeriod, Time[i], false);
PP = (iHigh(Symbol(), myPeriod, dayi + 1) +
iLow(Symbol(), myPeriod, dayi + 1) +
iClose(Symbol(), myPeriod, dayi + 1)) / 3;
//----
P1Buffer[i] = PP;
SetPrice("WeekP", Time[i], PP, Blue);
SetText("txtWeekP", "WeekP", Time[i], PP, Blue);
}
//----
return(0);
}
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
void SetPrice(string name, datetime Tm, double Prc, color clr)
{
if(ObjectFind(name) == -1)
{
ObjectCreate(name, OBJ_ARROW, 0, Tm, Prc);
ObjectSet(name, OBJPROP_COLOR, clr);
ObjectSet(name, OBJPROP_WIDTH, 1);
ObjectSet(name, OBJPROP_ARROWCODE, SYMBOL_RIGHTPRICE);
}
else
{
ObjectSet(name, OBJPROP_TIME1, Tm);
ObjectSet(name, OBJPROP_PRICE1, Prc);
ObjectSet(name, OBJPROP_COLOR, clr);
ObjectSet(name, OBJPROP_WIDTH, 1);
ObjectSet(name, OBJPROP_ARROWCODE, SYMBOL_RIGHTPRICE);
}
}
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
void SetText(string name, string txt, datetime Tm, double Prc, color clr)
{
if(ObjectFind(name) == -1)
{
ObjectCreate(name, OBJ_TEXT, 0, Tm, Prc);
ObjectSetText(name, txt, 10, "Times New Roman", clr);
ObjectSet(name, OBJPROP_CORNER, 2);
}
else
{
ObjectSet(name, OBJPROP_TIME1, Tm);
ObjectSet(name, OBJPROP_PRICE1, Prc);
ObjectSetText(name, txt, 10, "Times New Roman", clr);
ObjectSet(name, OBJPROP_CORNER, 2);
}
}
//+------------------------------------------------------------------+
وهذا كود المؤشر للبايفوت الشهري :
كود PHP:
#property copyright "Copyright © 2007, Waddah Attar"
#property link "[email protected]"
//----
#property indicator_chart_window
#property indicator_buffers 1
#property indicator_color1 Blue
//---- buffers
double P1Buffer[];
//----
int myPeriod = PERIOD_MN1;
//----
double PP;
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
SetIndexBuffer(0, P1Buffer);
//----
SetIndexStyle(0, DRAW_LINE, STYLE_SOLID, 2);
//----
Comment("By eng.Waddah Attar");
return(0);
}
//+------------------------------------------------------------------+
//| Custor indicator deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
ObjectDelete("MonthP");
Comment("");
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()
{
int i, dayi, counted_bars = IndicatorCounted();
//---- check for possible errors
if(counted_bars < 0)
return(-1);
//---- last counted bar will be recounted
if(counted_bars > 0)
counted_bars--;
int limit = Bars - counted_bars;
//----
for(i = limit - 1; i >= 0; i--)
{
dayi = iBarShift(Symbol(), myPeriod, Time[i], false);
PP = (iHigh(Symbol(), myPeriod, dayi + 1) +
iLow(Symbol(), myPeriod, dayi + 1) +
iClose(Symbol(), myPeriod, dayi + 1)) / 3;
//----
P1Buffer[i] = PP;
SetPrice("MonthP", Time[i], PP, Blue);
SetText("txtMonthP", "MonthP", Time[i], PP, Blue);
}
//----
return(0);
}
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
void SetPrice(string name, datetime Tm, double Prc, color clr)
{
if(ObjectFind(name) == -1)
{
ObjectCreate(name, OBJ_ARROW, 0, Tm, Prc);
ObjectSet(name, OBJPROP_COLOR, clr);
ObjectSet(name, OBJPROP_WIDTH, 1);
ObjectSet(name, OBJPROP_ARROWCODE, SYMBOL_RIGHTPRICE);
}
else
{
ObjectSet(name, OBJPROP_TIME1, Tm);
ObjectSet(name, OBJPROP_PRICE1, Prc);
ObjectSet(name, OBJPROP_COLOR, clr);
ObjectSet(name, OBJPROP_WIDTH, 1);
ObjectSet(name, OBJPROP_ARROWCODE, SYMBOL_RIGHTPRICE);
}
}
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
void SetText(string name, string txt, datetime Tm, double Prc, color clr)
{
if(ObjectFind(name) == -1)
{
ObjectCreate(name, OBJ_TEXT, 0, Tm, Prc);
ObjectSetText(name, txt, 10, "Times New Roman", clr);
ObjectSet(name, OBJPROP_CORNER, 2);
}
else
{
ObjectSet(name, OBJPROP_TIME1, Tm);
ObjectSet(name, OBJPROP_PRICE1, Prc);
ObjectSetText(name, txt, 10, "Times New Roman", clr);
ObjectSet(name, OBJPROP_CORNER, 2);
}
}
//+------------------------------------------------------------------+
[quote=وضاح عطار;558400]أهلا بك أخي
هذا كود المؤشر للبايفوت اليومي :
[php]
#property copyright "Copyright © 2007, Waddah Attar"
#property link "[email protected]"
//----
[quote=وضاح عطار;558403]وهذا كود المؤشر للبايفوت الأسبوعي :
[php]
#property copyright "Copyright © 2007, Waddah Attar"
#property link "[email protected]"
//----
مشكور يا مشرفنا الغالي ما قصرت بس أخيك دلخ بالنسبة للأكواد ياليت ترفق لي المؤشرات أكون شاكر لك والله جالس متحير ماني داري وش السواد مع الأكواد هذه .
وتقبل فائق إحترامي وتقديري
المخلص لك/ أبو عبدالله
القصد هو تعليمك كيف تستفيد من الكود مباشرة
المهم هذه هي المؤشرات الثلاث في المرفقات
أهلا بك دائما أخي الكريم