Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 6. - page 42 1...353637383940414243444546474849...1177 New comment Boeing747 2013.07.19 14:42 #411 Forexman77 : Thank you very much! Look at the second option... I think it's more reliable than the first. forexman77 2013.07.19 21:19 #412 I need to mark a Friday on the chart with an arrow. I tried to make an indicator according to the template. There are no errors, but the arrow does not appear. What could be the reason?//+------------------------------------------------------------------+ //| пятый день.mq4 | //| | //| | //+------------------------------------------------------------------+ #property copyright "" #property link "" #property indicator_chart_window #property indicator_buffers 1 #property indicator_color1 Aqua //--- buffers double ExtMapBuffer1[]; //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ int init() { //---- indicators SetIndexStyle(0,DRAW_ARROW); SetIndexArrow(0,217); SetIndexBuffer(0,ExtMapBuffer1); SetIndexEmptyValue(0,0.0); //---- return(0); } //+------------------------------------------------------------------+ //| Custom indicator deinitialization function | //+------------------------------------------------------------------+ int deinit() { //---- //---- return(0); } //+------------------------------------------------------------------+ //| Custom indicator iteration function | //+------------------------------------------------------------------+ int start() { int counted_bars=IndicatorCounted(), pyatnica, limit; if(counted_bars>0) counted_bars--; limit=Bars-counted_bars; for(int i=0;i<limit;i++) { pyatnica = (DayOfWeek() == 5); { ExtMapBuffer1[i]=pyatnica; } } return(0); } //+------------------------------------------------------------------+ TarasBY 2013.07.19 22:53 #413 pyatnica = (TimeDayOfWeek (Time[i]) == 5); if (pyatnica) ExtMapBuffer1[i] = Bid; and there will be arrows all Friday. Victor Nikolaev 2013.07.19 23:35 #414 TarasBY : and there will be arrows all Friday. Only they will be off-screen forexman77 2013.07.19 23:40 #415 Wrote the code. int start() { int counted_bars=IndicatorCounted(), pyatnica, limit; if(counted_bars>0) counted_bars--; limit=Bars-counted_bars; for(int i=0;i<limit;i++) { pyatnica = (TimeDayOfWeek (Time[i]) == 5); if (pyatnica) ExtMapBuffer1[i] = Bid; { ExtMapBuffer1[i]=pyatnica; } } return(0); } error: 'pyatnica' - comparison expression expected. PapaYozh 2013.07.20 00:04 #416 Forexman77 : I have written the code. error: 'pyatnica' - comparison expression expected. Since your variable is of the int type, you should write it like this: if (pyatnica!=0) ExtMapBuffer1[i] = Bid; Also, you have missed else. forexman77 2013.07.20 00:27 #417 PapaYozh : Since you have an int type variable, you should write it like this: and also, you're missing else. Thank you, it worked. Only why "pyatnica" to write in double, it seems to be an integer? I tried it in int also works. forexman77 2013.07.20 00:39 #418 Vinin : Only be off-screen There is such a thing. From time to time the arrows fly up or down. Is it possible to link them to the graph axis? TarasBY 2013.07.20 07:30 #419 Forexman77 : There is such a thing. From time to time the arrows fly up or down. Is it possible to link them to the graph axis? bool pyatnica; // убрать её объявление из int for(int i=0;i<limit;i++) { pyatnica = (TimeDayOfWeek (Time[i]) == 5); if (pyatnica) ExtMapBuffer1[i] = Bid; } TarasBY 2013.07.20 10:00 #420 Vinin : Just be off the screen.How did you know he was going to write "nonsense" again! :))) P.S. By the way, I didn't pay attention to "what type of pyatnica" right away. 1...353637383940414243444546474849...1177 New comment
Thank you very much!
pyatnica = (TimeDayOfWeek (Time[i]) == 5); if (pyatnica) ExtMapBuffer1[i] = Bid;and there will be arrows all Friday.and there will be arrows all Friday.
Only they will be off-screen
Wrote the code.
error: 'pyatnica' - comparison expression expected.I have written the code.
error: 'pyatnica' - comparison expression expected.Since your variable is of the int type, you should write it like this:
Also, you have missed else.Since you have an int type variable, you should write it like this:
and also, you're missing else.Only be off-screen
There is such a thing. From time to time the arrows fly up or down. Is it possible to link them to the graph axis?
There is such a thing. From time to time the arrows fly up or down. Is it possible to link them to the graph axis?
How did you know he was going to write "nonsense" again! :)))
P.S. By the way, I didn't pay attention to "what type of pyatnica" right away.