اقتباس:
المشاركة الأصلية كتبت بواسطة wajdyss
اخواني الكرام لقد قمت بصنع مؤشر وهو على الرابط التالي والمطلوب هو كتابة الاسعار بجانب الخطوط ما الدالة المناسبة لها |
استخدم الوظيفة التالية :
كود PHP:
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);
}
}
ويصبح مؤشرك كالتالي :
كود PHP:
//+------------------------------------------------------------------+
//| wajdyss lines.mq4 |
//| Copyright © 2008, wajdyss|
//| wajdyss@yahoo.com |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2008, wajdyss"
#property link "wajdyss@yahoo.com"
#property indicator_chart_window
#property indicator_buffers 8
#property indicator_color1 Lime
#property indicator_color2 Lime
#property indicator_color3 Lime
#property indicator_color4 Lime
#property indicator_color5 Lime
#property indicator_color6 Lime
#property indicator_color7 Lime
#property indicator_color8 Lime
extern int how_long=10000; // bars to be counted (-1 - all the bars)
extern double pips=125;
extern double startprice=1.5000;
//---- indicator buffers
double ExtMapBuffer1[];
double ExtMapBuffer2[];
double ExtMapBuffer3[];
double ExtMapBuffer4[];
double ExtMapBuffer5[];
double ExtMapBuffer6[];
double ExtMapBuffer7[];
double ExtMapBuffer8[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
Comment("wajdyss_lines");
SetIndexBuffer(0, ExtMapBuffer1);
SetIndexStyle(0, DRAW_LINE);
SetIndexBuffer(1, ExtMapBuffer2);
SetIndexStyle(1, DRAW_LINE);
SetIndexBuffer(2, ExtMapBuffer3);
SetIndexStyle(2, DRAW_LINE);
SetIndexBuffer(3, ExtMapBuffer4);
SetIndexStyle(3, DRAW_LINE);
SetIndexBuffer(4, ExtMapBuffer5);
SetIndexStyle(4, DRAW_LINE);
SetIndexBuffer(5, ExtMapBuffer6);
SetIndexStyle(5, DRAW_LINE);
SetIndexBuffer(6, ExtMapBuffer7);
SetIndexStyle(6, DRAW_LINE);
SetIndexBuffer(7, ExtMapBuffer8);
SetIndexStyle(7, DRAW_LINE);
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function