[ARCHIVE!] Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Can't go anywhere without you - 4. - page 135

 
The day after tomorrow
 
tara:
The day after tomorrow

I'm afraid I won't see it in the stream of messages.
 

Can you tell me what topBuffer[i]=2147483647 means ?

 
Can you please tell me how to call the numeric value of the indicator window size top=WindowPriceMax(win_idx) in another indicator to work with it as a simple variable?
 

Please guide me in the right direction. I want to write a condition so that the EA does not trade on Monday on the first 2 bars of H4. I wrote a condition (below), which does not work and I do not know what to do, so I am writing it here. In the tester (to check) I put the result in the comment, TimeDayOfWeek() shows the change of the day of the week, but iBarShift() doesn't react to appearance of a new bar - the result=0.

if (TimeDayOfWeek(TimeCurrent())==1)
{  if (iBarShift(NULL,PERIOD_H4,TimeCurrent(),false)<=2)
   return(0);
}
 
paladin80:

I want to write a condition so that the EA does not trade on Monday on the first 2 bars of H4. I wrote a condition (below), which does not work and I do not know what to do, so I am writing it here. In the tester (to check) I put the result in the comment, TimeDayOfWeek() shows the change of the day of the week, but iBarShift() doesn't react to appearance of a new bar - the result=0 .


Have you tested it on H4?
 
alsu:
look at how looped EAs are written, this is the standard for multicurrency/multi-timeframes, because it eliminates the need to wait for a tick on the chart where the EA is hovering, and allows you to process all the necessary charts in real time.


Good afternoon!

I've read this before, but I don't need it yet. My program is uncomplicated and there is no need, until a new bar opens in M1, for it to work.

By the way, I've already tried it, but the program loops so that it doesn't open or show anything. May need it in the future, then I'll look into it thoroughly.

Much obliged for all your advice!

 
Roman.:

Tested on H4?
During the test I put H4. Maybe the condition could be written differently, e.g. positions cannot be opened until 8 o'clock on Monday.
 
paladin80:
During the test I put H4. Maybe the condition could be written differently, e.g. no positions can be opened until 8 o'clock on Monday.

Exactly how you write it - it will work on all timeframes
 
paladin80:
During the test I put H4. Maybe the condition could be written differently, e.g. positions cannot be opened until 8 o'clock on Monday.


Try it this way:

if (TimeDayOfWeek(TimeCurrent())==1)
               if (TimeHour(TimeCurrent()) <= 8)  return(0);
Reason: