... and :
DayOfWeek() returns zero-based day of the week (0-Sunday,1,2,3,4,5,6)
Thus Wednesday is 3 (not 4)
- Ralf Graf: DayOfWeek() returns zero-based day of the week (0-Sunday,1,2,3,4,5,6) Thus Wednesday is 3 (not 4)It returns an int for backwards compatibility. Use the enumeration and make your code self documenting, with no wrong numbers:
ENUM_DAY_OF_WEEK dow = (ENUM_DAY_OF_WEEK)DayOfWeek(); if(dow == WEDNESDAY) ...
Symbol Properties - Environment State - Standard Constants, Enumerations and Structures - MQL4 Reference - SIRAJ Multani: modify my code that will restrict the indcator to work only on WEDNESDAY and when I load them on my chart it should be showing arrows only on wednesdays.Ambiguous. Ralf's suggestion will allow the indicator to work only on Wednesday. But if it does work it will paint all bars. If you want to only paint Wednesday's bars you'll need:
if( (ENUM_DAY_OF_WEEK)TimeDayOfWeek(Time[i])== Wednesday) Buffer1[i] = Low[i] - 3 * myPoint;
if(iLow(NULL,PERIOD_M30,i) < iLow(NULL,PERIOD_M30,1+i) && iLow(NULL,PERIOD_M30,1+i) > iLow(NULL,PERIOD_M30,1+i+1) //Candlestick Low crosses below Candlestick Low
You have restricted the indicator to the M30 chart. Why? If the chart is not M30 then you are mixing apples and oranges and you must handle 4066/4073 errors.
Download history in MQL4 EA - MQL4 and MetaTrader 4 - MQL4 programming forum- Your lookback is two.
How to do your lookbacks correctly.
- It returns an int for backwards compatibility. Use the enumeration and make your code self documenting, with no wrong numbers: Symbol Properties - Environment State - Standard Constants, Enumerations and Structures - MQL4 Reference
- Ambiguous. Ralf's suggestion will allow the indicator to work only on Wednesday. But if it does work it will paint all bars. If you want to only paint Wednesday's bars you'll need:
- You have restricted the indicator to the M30 chart. Why? If the chart is not M30 then you are mixing apples and oranges and you must handle
4066/4073 errors.
Download history in MQL4 EA - MQL4 and MetaTrader 4 - MQL4 programming forum - Your lookback is two.
How to do your lookbacks correctly.
I tried this it works, but with the PERIOD_M30 I get the solution by using iBarShift and that worked too.
Seriously guys, you are just awsome....you deserve lot of respect. Thank you so much for helping me.
I tried this it works, but with the PERIOD_M30 I get the solution by using iBarShift and that worked too.
Seriously guys, you are just awsome....you deserve lot of respect. Thank you so much for helping me.
extern ENUM_DAY_OF_WEEK DAY = WEDNESDAY; Comment( DAY ); return(0); } //+------------------------------------------------------------------+
When I try this on Comment it returns 3 and not WEDNESDAY on the chart . On My chart I was expecting my Comment will display WEDNESDAY
I dont know where is the Mistake, please Help
string as_string(ENUM_DAY_OF_WEEK dow, COUNT len=0){ string DOW_xxx = EnumToString(dow); // DOW_XXX return StringSubstr(DOW_xxx, 4, len); // XXX }Comment( as_string(DAY) );
Comment( as_string(DAY) );
return(0); } //+------------------------------------------------------------------+ string as_string(ENUM_DAY_OF_WEEK dow, COUNT len=0) { string DOW_xxx = EnumToString(dow); // DOW_XXX return StringSubstr(DOW_xxx, 4, len); // XXX } Comment( as_string(DAY) ); //+------------------------------------------------------------------+ void OnDeinit(const int reason) { Comment(""); }
this gives me 4 errors
'COUNT' - declaration without type
'len' - comma expected
'Comment' - declaration without type
'len' - undeclared identifier
You couln't figure out that COUNT is a uint?
You couln't figure out that COUNT is a uint?
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Dear coder, please help to modify my code that will restrict the indcator to work only on WEDNESDAY and when I load them on my chart it should be showing arrows only on wednesdays.
Thanking you
in Advance.