النتائج 46 إلى 59 من 59
- 21-08-2017, 10:46 PM #46
اسفل هو المقصد من يوم امس--عى الباكتستر الفوري نتائج رائعة جدا
1) ازاحة-7
2) رسم ترند يغطي المسافة المزاحة
كود PHP:#property indicator_chart_window
#property indicator_buffers 2
#property indicator_color1 clrYellow
#property indicator_color2 clrYellow
//---- indicator parameters
int MA_Period=14;
int MA_Shift=-7;
int MA_Method=0;
int Applied_Price=0;
double Deviation1=2;
//---- indicator buffers
double ExtMapBuffer1[];
double ExtMapBuffer2[];
//----
int ExtCountedBars=0;
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
int draw_begin;
//string short_name;
//---- drawing settings
SetIndexStyle(0,DRAW_LINE);
SetIndexStyle(1,DRAW_LINE);
SetIndexShift(0,MA_Shift);
SetIndexShift(1,MA_Shift);
IndicatorDigits(MarketInfo(Symbol(),MODE_DIGITS));
if(MA_Period<2) MA_Period=14;
draw_begin=MA_Period-1;
//---- indicator short name
IndicatorShortName("Env("+MA_Period+")");
SetIndexLabel(0,"Env("+MA_Period+")Upper");
SetIndexLabel(1,"Env("+MA_Period+")Lower");
SetIndexDrawBegin(0,draw_begin);
SetIndexDrawBegin(1,draw_begin);
//---- indicator buffers mapping
SetIndexBuffer(0,ExtMapBuffer1);
SetIndexBuffer(1,ExtMapBuffer2);
if(Deviation1<0.1) Deviation1=0.1;
if(Deviation1>100.0) Deviation1=100.0;
//---- initialization done
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()
{
int limit;
if(Bars<=MA_Period) return(0);
ExtCountedBars=IndicatorCounted();
//---- check for possible errors
if (ExtCountedBars<0) return(-1);
//---- last counted bar will be recounted
if (ExtCountedBars>0) ExtCountedBars--;
limit=Bars-ExtCountedBars;
//---- EnvelopesM counted in the buffers
//---- done
for(int i=0; i<limit; i++)
{
ExtMapBuffer1[i] = (1+Deviation1/100) *iMA(NULL,0,MA_Period,0,MA_Method,PRICE_CLOSE,i);
ExtMapBuffer2[i] = (1-Deviation1/100) *iMA(NULL,0,MA_Period,0,MA_Method,PRICE_CLOSE,i);
}
ObjectDelete( "ExtMapBuffer_1");
ObjectDelete( "ExtMapBuffer_2");
ObjectCreate( "ExtMapBuffer_1",OBJ_TREND,0,iTime(Symbol(),0, 2-MA_Shift),ExtMapBuffer1[2],iTime(Symbol(),0, 1-MA_Shift),ExtMapBuffer1[1]);
ObjectCreate( "ExtMapBuffer_2",OBJ_TREND,0,iTime(Symbol(),0, 2-MA_Shift),ExtMapBuffer2[2],iTime(Symbol(),0, 1-MA_Shift),ExtMapBuffer2[1]);
ObjectDelete( "ExtMapBuffer_3");
ObjectDelete( "ExtMapBuffer_4");
ObjectCreate( "ExtMapBuffer_3",OBJ_TREND,0,iTime(Symbol(),0, 3-MA_Shift),ExtMapBuffer1[3],iTime(Symbol(),0, 1-MA_Shift),ExtMapBuffer1[1]);
ObjectCreate( "ExtMapBuffer_4",OBJ_TREND,0,iTime(Symbol(),0, 3-MA_Shift),ExtMapBuffer2[3],iTime(Symbol(),0, 1-MA_Shift),ExtMapBuffer2[1]);
ObjectDelete( "ExtMapBuffer_5");
ObjectDelete( "ExtMapBuffer_6");
ObjectCreate( "ExtMapBuffer_5",OBJ_TREND,0,iTime(Symbol(),0, 3-MA_Shift),ExtMapBuffer1[3],iTime(Symbol(),0, 2-MA_Shift),ExtMapBuffer1[2]);
ObjectCreate( "ExtMapBuffer_6",OBJ_TREND,0,iTime(Symbol(),0, 3-MA_Shift),ExtMapBuffer2[3],iTime(Symbol(),0, 2-MA_Shift),ExtMapBuffer2[2]);
return(0);
}
//+------------------------------------------------------------------+
- 21-08-2017, 10:47 PM #47
نتيجة الكود السابق:
فوائد) تحيز لصفقات اتجاه الترند
2) ابعاد الصفقات التي قد يحدث عنها انقلاب
- 21-08-2017, 10:48 PM #48
قيمة البفر عند 0 نجعلها قيمة الترند عند 0
- 22-08-2017, 02:56 AM #49
- 22-08-2017, 03:18 AM #50
اذا كنت برمجتها سابقا , والمعادلة لا تعيد رسم نفسها....اذا يجب أن تحصل علي جائزة نوبل علي هكذا إنجاز.
أنا الذي اعرفه أن أغلب المعادلات التي تحقق هذا ,هي معادلات أحصائية, كمؤشر مركز الثقل أو معادلات مثل Hodrick–Prescott filter و FFT , وكلها تعيد الرسم للأسف.
أتمني ان تعيد برمجتها مجددا,.....وما هو الاساس الرياضي أو المعادلة الرياضية التي استخدمتها ؟
- 22-08-2017, 03:44 AM #51
حتي وان رسمنا ترند يغطي المسافة المزاحة, سوف يعيد رسم نفسه وتغيير اتجاهه علي كامل المسافة المزاحة, كل شمعة جديدة ,حتي وان ألغينا الشمعة 0.
.
حتي كود المؤشر الذي وضعته من الواضح جدا ان الترندات تغيير أتجاهها كل شمعة جديدة.
لاحظ الصورة
لاحظ لان بعد مرور 5 شمعات...مع العلم ان الازاحة -7 شمعات
فكما قلت لك أخي هذه الطريقة طرحت قديما و جربت من قبل ولم تكن النتيجة مرضية.
لهذا نحتاج التفكير في طريقة أخري نجعل بها منحني المؤشر كمنحني السعر غير هذه الطريقة.
- 22-08-2017, 08:44 AM #52
انا فاهمك منذ البدء أخي
ترى نلقط بسرعة
صحيح خط الترند اليوم مرسوم على شمعة 2 و 1
غدا شمعة 1 و 2 ستصبح 2 و 3
وسيرسم على 1 و 2 الجديدة
في هذه الحالة ليست اعادة رسم--بل الغاء رسمة سابقة
نحن يهمنا قيمة الترند عند اليوم صفر
هذا الترند يتغير الساعة 00:00 كل يوم---مرة واحدة وبالتالي قلنا لا اعادة رسم
من الساعة 00:00 وحتى 23:59 القيمة ثابتة وهو مايهمنا لكل يوم.
فترند الامس ليوم الامس
وترند اليوم لهذا اليوم
مجرد حذفنا سعر الشمعة 0 من الحسابات ننسى نهائيا اعادة الرسم اثناء التداول وبالتالي نتحاشى ال False triggers
نحن ممكن نترك اترندات السابقة ولكن سيصبح المؤشر قشة جنية!! ولايبنى عليها قرار
- 22-08-2017, 08:47 AM #53
فنحن هذا ما نريده ان يتعدل الترند الساعة 00:00 الى القيمة الجديدة مع ميل المؤشر
المؤشر نفسه الماكد او غيره يوميا الساعة 00:00 يتغير--ثم اذا كان مرتبط بالسعر يتغير المؤشر اثناء اليوم
ولكن الترند اعلاه مع التحديث اليومي يبتل على نفس القيمة الافتتاحية حتى الساعة 00:00 لليوم اللاحق
- 22-08-2017, 08:49 AM #54
نأتي للميل خصوصا انك ممكن ترسم ترند او ترندين او ثلاثة او حتى 4, حسب اختيارك للزوج المرتب,
هذه فكرة اضافية, الخبرة تختصرها, والملاحظة تكتشفها
الان ارجع مرة اخرى لصورة الرد #47
قرب الحد العلوي
وابعد الحد السفلي
اصبح متحيز لتقريب سعر البيع-- اكثر
وابعاد سعر الشراء اكثر
زي اللي مشتهي يدخل بيع ولكن ينتظر سعر افضل ممكن التحقق
- 22-08-2017, 08:53 AM #55
هذا الكود اخي
لاحظ كيف تم التحايل على خطوط الترند وكأنها غر موجودة--وقد ترى انت الامور بشكل اخر او افضل,
حاليا نفس المؤشر ازاحة ثم تمديد دون وجود الترند (استخدمنا الترند بروكسي مؤقت)
مممكن تسنخدم لوووب لللاسطر الاخيرة ولكن هنا فقط اردت التوضيح بالتفيصيل.
-
-
كود PHP:#property indicator_chart_window
#property indicator_buffers 6
#property indicator_color1 clrYellow
#property indicator_color2 clrYellow
#property indicator_color3 clrLightCoral
#property indicator_color4 clrLightCoral
#property indicator_color5 clrRed
#property indicator_color6 clrRed
//---- indicator parameters
int MA_Period=14;
int MA_Method=0;
int Applied_Price=0;
double Deviation1=2;
//---- indicator buffers
double ExtMapBuffer1[];
double ExtMapBuffer2[];
double ExtMapBuffer1X[];
double ExtMapBuffer2X[];
double ExtMapBuffer1Y[];
double ExtMapBuffer2Y[];
//----
int ExtCountedBars=0;
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
SetIndexBuffer(0,ExtMapBuffer1);
SetIndexBuffer(1,ExtMapBuffer2);
SetIndexBuffer(2,ExtMapBuffer1X);
SetIndexBuffer(3,ExtMapBuffer2X);
SetIndexBuffer(4,ExtMapBuffer1Y);
SetIndexBuffer(5,ExtMapBuffer2Y);
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()
{
int limit;
if(Bars<=MA_Period) return(0);
ExtCountedBars=IndicatorCounted();
//---- check for possible errors
if (ExtCountedBars<0) return(-1);
//---- last counted bar will be recounted
if (ExtCountedBars>0) ExtCountedBars--;
limit=Bars-ExtCountedBars;
//---- EnvelopesM counted in the buffers
//---- done
for(int i=0; i<limit; i++)
{
ExtMapBuffer1X[i] = (1+Deviation1/100) *iMA(NULL,0,MA_Period,0,MA_Method,PRICE_CLOSE,i);
ExtMapBuffer2X[i] = (1-Deviation1/100) *iMA(NULL,0,MA_Period,0,MA_Method,PRICE_CLOSE,i);
}
for(i=0; i<limit; i++)
{
ExtMapBuffer1[i+7] = ExtMapBuffer1X[i];
ExtMapBuffer2[i+7] = ExtMapBuffer2X[i];
}
ObjectDelete( "ExtMapBuffer_1");
ObjectDelete( "ExtMapBuffer_2");
ObjectCreate( "ExtMapBuffer_1",OBJ_TREND,0,iTime(Symbol(),0, 9),ExtMapBuffer1X[2],iTime(Symbol(),0, 8),ExtMapBuffer1X[1]);
ObjectCreate( "ExtMapBuffer_2",OBJ_TREND,0,iTime(Symbol(),0, 9),ExtMapBuffer2X[2],iTime(Symbol(),0, 8),ExtMapBuffer2X[1]);
ExtMapBuffer1[0] = ObjectGetValueByShift("ExtMapBuffer_1",0);
ExtMapBuffer2[0] = ObjectGetValueByShift("ExtMapBuffer_2",0);
ExtMapBuffer1[1] = ObjectGetValueByShift("ExtMapBuffer_1",1);
ExtMapBuffer2[1] = ObjectGetValueByShift("ExtMapBuffer_2",1);
ExtMapBuffer1[2] = ObjectGetValueByShift("ExtMapBuffer_1",2);
ExtMapBuffer2[2] = ObjectGetValueByShift("ExtMapBuffer_2",2);
ExtMapBuffer1[3] = ObjectGetValueByShift("ExtMapBuffer_1",3);
ExtMapBuffer2[3] = ObjectGetValueByShift("ExtMapBuffer_2",3);
ExtMapBuffer1[4] = ObjectGetValueByShift("ExtMapBuffer_1",4);
ExtMapBuffer2[4] = ObjectGetValueByShift("ExtMapBuffer_2",4);
ExtMapBuffer1[5] = ObjectGetValueByShift("ExtMapBuffer_1",5);
ExtMapBuffer2[5] = ObjectGetValueByShift("ExtMapBuffer_2",5);
ExtMapBuffer1[6] = ObjectGetValueByShift("ExtMapBuffer_1",6);
ExtMapBuffer2[6] = ObjectGetValueByShift("ExtMapBuffer_2",6);
ExtMapBuffer1[7] = ObjectGetValueByShift("ExtMapBuffer_1",7);
ExtMapBuffer2[7] = ObjectGetValueByShift("ExtMapBuffer_2",7);
ExtMapBuffer1[8] = ObjectGetValueByShift("ExtMapBuffer_1",8);
ExtMapBuffer2[8] = ObjectGetValueByShift("ExtMapBuffer_2",8);
ObjectDelete( "ExtMapBuffer_1");
ObjectDelete( "ExtMapBuffer_2");
return(0);
}
//+------------------------------------------------------------------+
آخر تعديل بواسطة فيلسوف البادية ، 22-08-2017 الساعة 08:59 AM
- 22-08-2017, 08:55 AM #56
هل تشعر بوجود خطوط ترند أسفل:
كلها بفرز, وبالتالي نستطيع استخدام ال iCustom بارتياح شديد
وفي الباكتستر كأنك تستخدم الماكد او الغلاف الاصلي بشكل سلس,
- 24-08-2017, 12:12 PM #57
أخي, دعنا نتفق أن لدينا مشكلتان, هما البعدية و الازاحة, وكل مشكلة منهما تلغي الاخري وهي في حد ذاتها مشكلة .
اذا لايمكننا الغاء مشكلة بمشكلة ولا يمكننا حل المشكلتين معا, حتي الان كل ما نقوم به هو محاولة ترقيع أو تخفيف تأثير أحدي المشكلتين ومن الوضح أن هذا كل ما نستطيع عمله حتي الان.
وكل ما أستطعت فعله في السابق هو تقليل تأثير المشكلتين الي أقصي مايمكن حيث قللت من قيمة الازاحة الي الربع تقريبا مع الحفاظ علي المؤشر قدر الامكان مع السعر.
ٍسأرفق مثال عن الطريقة التي استخدمتها لفعل ذالك في المشاركة القادمة , ربما تستطيع ان تستفيد منها أو تطورها أكثر
- 24-08-2017, 02:26 PM #58
مثال
أستخدمت مؤشرك كمثال لتسهيل الفهم ... حاول تدرس المعادلات لتطور من المؤشر
كود PHP:#property indicator_chart_window
#property indicator_buffers 11
//#property indicator_color1 clrYellow
//#property indicator_color2 clrYellow
//#property indicator_color3 clrLightCoral
//#property indicator_color4 clrLightCoral
#property indicator_color5 clrRed
#property indicator_color6 clrRed
#property indicator_color7 DeepPink
#property indicator_color8 DodgerBlue
#property indicator_color9 clrYellow
//---- indicator parameters
int MA_Period=14;
int MA_Method=0;
int Applied_Price=0;
double Deviation1=0.3;
//**************************
extern int phase_shift=4;
extern double Index_factor=1.5;
extern int MA_Period2=7;
extern int MA_Method2=3;
extern double Deviation2=0.3;
extern int Index_Shift=0;
//---- indicator buffers
double ExtMapBuffer1[];
double ExtMapBuffer2[];
double ExtMapBuffer1X[];
double ExtMapBuffer2X[];
double ExtMapBuffer1Y[];
double ExtMapBuffer2Y[];
//****************
double a1[],a2[],B1[],B2[],v1[];
//----
int ExtCountedBars=0;
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int OnInit()
{
ArraySetAsSeries(a1,true);ArraySetAsSeries(a2,true);
SetIndexBuffer(0,ExtMapBuffer1);
SetIndexBuffer(1,ExtMapBuffer2);
SetIndexBuffer(2,ExtMapBuffer1X);
SetIndexBuffer(3,ExtMapBuffer2X);
SetIndexBuffer(4,ExtMapBuffer1Y);
SetIndexBuffer(5,ExtMapBuffer2Y);
//*******
SetIndexStyle(6,DRAW_LINE,0,2); SetIndexBuffer(6,B1);SetIndexShift(6,Index_Shift);
SetIndexStyle(7,DRAW_LINE,0,2); SetIndexBuffer(7,B2);SetIndexShift(7,Index_Shift);
SetIndexStyle(8,DRAW_LINE); SetIndexBuffer(8,v1);SetIndexShift(8,Index_Shift);
return(INIT_SUCCEEDED);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int OnCalculate (const int rates_total, // size of input time series
const int prev_calculated, // bars handled in previous call
const datetime& time[], // Time
const double& open[], // Open
const double& high[], // High
const double& low[], // Low
const double& close[], // Close
const long& tick_volume[], // Tick Volume
const long& volume[], // Real Volume
const int& spread[] ) // Spread
{
int limit;
if(rates_total<=MA_Period )
return(0);
//--- last counted bar will be recounted
limit=rates_total-prev_calculated-MA_Period*2;
if(prev_calculated>0)
limit++;
//***************
ArrayResize(a1,limit,0);ArrayResize(a2,limit,0);
//---- EnvelopesM counted in the buffers
//---- done
for(int i=0; i<limit; i++)
{
ExtMapBuffer1X[i] = (1+Deviation1/100) *iMA(NULL,0,MA_Period,0,MA_Method,PRICE_CLOSE,i);
ExtMapBuffer2X[i] = (1-Deviation1/100) *iMA(NULL,0,MA_Period,0,MA_Method,PRICE_CLOSE,i);
}
for(i=0; i<limit; i++)
{
ExtMapBuffer1[i+7] = ExtMapBuffer1X[i];
ExtMapBuffer2[i+7] = ExtMapBuffer2X[i];
}
ObjectDelete( "ExtMapBuffer_1");
ObjectDelete( "ExtMapBuffer_2");
ObjectCreate( "ExtMapBuffer_1",OBJ_TREND,0,iTime(Symbol(),0, 9),ExtMapBuffer1X[2],iTime(Symbol(),0, 8),ExtMapBuffer1X[1]);
ObjectCreate( "ExtMapBuffer_2",OBJ_TREND,0,iTime(Symbol(),0, 9),ExtMapBuffer2X[2],iTime(Symbol(),0, 8),ExtMapBuffer2X[1]);
ExtMapBuffer1[0] = ObjectGetValueByShift("ExtMapBuffer_1",0);
ExtMapBuffer2[0] = ObjectGetValueByShift("ExtMapBuffer_2",0);
ExtMapBuffer1[1] = ObjectGetValueByShift("ExtMapBuffer_1",1);
ExtMapBuffer2[1] = ObjectGetValueByShift("ExtMapBuffer_2",1);
ExtMapBuffer1[2] = ObjectGetValueByShift("ExtMapBuffer_1",2);
ExtMapBuffer2[2] = ObjectGetValueByShift("ExtMapBuffer_2",2);
ExtMapBuffer1[3] = ObjectGetValueByShift("ExtMapBuffer_1",3);
ExtMapBuffer2[3] = ObjectGetValueByShift("ExtMapBuffer_2",3);
ExtMapBuffer1[4] = ObjectGetValueByShift("ExtMapBuffer_1",4);
ExtMapBuffer2[4] = ObjectGetValueByShift("ExtMapBuffer_2",4);
ExtMapBuffer1[5] = ObjectGetValueByShift("ExtMapBuffer_1",5);
ExtMapBuffer2[5] = ObjectGetValueByShift("ExtMapBuffer_2",5);
ExtMapBuffer1[6] = ObjectGetValueByShift("ExtMapBuffer_1",6);
ExtMapBuffer2[6] = ObjectGetValueByShift("ExtMapBuffer_2",6);
ExtMapBuffer1[7] = ObjectGetValueByShift("ExtMapBuffer_1",7);
ExtMapBuffer2[7] = ObjectGetValueByShift("ExtMapBuffer_2",7);
ExtMapBuffer1[8] = ObjectGetValueByShift("ExtMapBuffer_1",8);
ExtMapBuffer2[8] = ObjectGetValueByShift("ExtMapBuffer_2",8);
ObjectDelete( "ExtMapBuffer_1");
ObjectDelete( "ExtMapBuffer_2");
for(i=0; i<limit; i++){ a2[i]=((ExtMapBuffer1[i+phase_shift]+ExtMapBuffer2[i+phase_shift])/2);}
//---------------------------------------------------
for(i=0; i<limit; i++){
a1[i]=iMA(NULL,0,7,0,0,0,i)-a2[i];
}
for(i=0; i<limit; i++){
B1[i]=(1+Deviation2/100)*((-iMAOnArray(a1,0,MA_Period2,0,MA_Method2,i)*Index_factor)+a2[i]);
B2[i]=(1-Deviation2/100)*((-iMAOnArray(a1,0,MA_Period2,0,MA_Method2,i)*Index_factor)+a2[i]);
v1[i]=2*((((1+Deviation2/100)*iMA(NULL,0,7,0,0,0,i))+(B2[i]))/2)-iMA(NULL,0,14,0,0,0,i);
}
return(0);
}
- 13-04-2018, 10:11 PM #59