السـلام عليكم ورحمة الله وبركاته
أرجو المساعدة بتحويل هذا الكود ليعمل على الشهري
بدل الأسبوعي علماَ بأنني حاولت تعديل الفترة من الأسبوعي
الى الشهري وباقي مسألة ( معقدة ) نوعاَ ما لذا أرجو المساعدة
كود PHP:
[LEFT]//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()[/LEFT]
[LEFT]{
int counted_bars=IndicatorCounted();[/LEFT]
[LEFT]int limit, i;
//---- indicator calculation
if (counted_bars==0)
{
x=Period();
if (x>2400) return(-1);
// ObjectCreate("R138", OBJ_TEXT, 0, 0,0);
// ObjectSetText("R138", " 138%",fontsize,"Arial",Yellow);
// ObjectCreate("R123", OBJ_TEXT, 0, 0, 0);
// ObjectSetText("R123", " 123%",fontsize,"Arial",Yellow);
// ObjectCreate("R100", OBJ_TEXT, 0, 0, 0);
// ObjectSetText("R100", " 100%",fontsize,"Arial",Aqua);
// ObjectCreate("R76", OBJ_TEXT, 0, 0, 0);
// ObjectSetText("R76", " 76%",fontsize,"Arial",Lime);
// ObjectCreate("R62", OBJ_TEXT, 0, 0, 0);
// ObjectSetText("R62", " 62%",fontsize,"Arial",Lime);
// ObjectCreate("R50", OBJ_TEXT, 0, 0, 0);
// ObjectSetText("R50", " 50%",fontsize,"Arial",Lime);
// ObjectCreate("R38", OBJ_TEXT, 0, 0, 0);
// ObjectSetText("R38", " 38%",fontsize,"Arial",Magenta);
// ObjectCreate("R23", OBJ_TEXT, 0, 0, 0);
// ObjectSetText("R23", " 23%",fontsize,"Arial",Lime);[/LEFT]
[LEFT]}
if(counted_bars<0) return(-1);
//---- last counted bar will be recounted
// if(counted_bars>0) counted_bars--;
limit=(Bars-counted_bars)-1;[/LEFT]
[LEFT]for (i=limit; i>=0;i--)
{ [/LEFT]
[LEFT]if (High[i+1]>LastMonthHigh) LastMonthHigh=High[i+1];
if (Low[i+1]<LastMonthLow) LastMonthLow=Low[i+1];[/LEFT]
[LEFT]if (TimeDayOfWeek(Time[i])==01 && TimeHour(Time[i])==00 && TimeMinute(Time[i])==00)
{
P=(LastMonthHigh+LastMonthLow+Close[i+1])/3;
Q = (LastMonthHigh - LastMonthLow);[/LEFT]
[LEFT]R1 = (2*P)-LastMonthLow;
S1 = (2*P)-LastMonthHigh;
R2 = P+(LastMonthHigh - LastMonthLow);
S2 = P-(LastMonthHigh - LastMonthLow);
R3 = (2*P)+(LastMonthHigh-(2*LastMonthLow));
S3 = (2*P)-((2* LastMonthHigh)-LastMonthLow); [/LEFT]