if(( Close_P)&&TimeCurrent()>=StrToTime( CloseHour+":00")){// даже по времени сделалint slippage=3;for(int i=OrdersTotal()-1; i>=0; i--){if(!OrderSelect( i, SELECT_BY_POS, MODE_TRADES))break;if(OrderType()==OP_BUY)OrderClose(OrderTicket(),OrderLots(),MarketInfo(OrderSymbol(),MODE_BID), slippage);if(OrderType()==OP_SELL)OrderClose(OrderTicket(),OrderLots(),MarketInfo(OrderSymbol(),MODE_ASK), slippage);}}
Gentlemen, could you please explain the difference between
from
I don't understand what iBarShift is and what it does
int iBarShift(
string symbol, int timeframe, datetime time, bool exact=false)
Search for a bar by time. The function returns the offset of the bar to which the specified time belongs. If there is no bar for the specified time (a "hole" in the history), the function returns, depending on the exact parameter, -1 or the offset of the nearest bar.
Parameters:
symbol
-
Symbol name of the instrument. NULL means current symbol.
string symbol, int timeframe, datetime time, bool exact=false)
Bar search by time. The function returns the offset of the bar to which the specified time belongs. If there is no bar for the specified time (a "hole" in the history), the function returns -1 or the offset of the nearest bar, depending on the exact parameter.
Parameters:
symbol
-
Symbol name of the instrument. NULL means current symbol.
Returned value if no bar is found. FALSE - iBarShift returns closest. TRUE - iBarShift returns -1.
I've read the reference, but I do not understand what it says: "The function returns the shift of the bar" - what does it mean? If I've read the first one, it simply means the number of candlesticks and the second one means some displacement. I think I need the nearest high after some conditions, the first case will not work because I may not see max 10 bars (and may not see max 20 or 30 either), how should I describe it correctly (the nearest high for example after crossing 2 Mascos)?
I've read the help, but I don't understand what it says, "The function returns the shift of the bar" - what does it mean? If I've read the first one, it simply means the number of candlesticks, and the second one means some displacement. I think I need the nearest high after some conditions, the first case will not work because I may not see max 10 bars (and may not see max 20 or 30 either), what will be the right way to do it (the nearest high after 2 Mascos crossing for example)?
ibarshift shows in which bar from the beginning of the chart the n-th second time
I've read it, but I don't understand what it says: "The function returns the bar shift" - what does it mean? If I've read the first one, it simply means the number of candlesticks, but the second one means some displacement. I think I need the nearest high after some conditions, the first case will not work because I may not see max 10 bars (and may not see max 20 or 30 either), what is the correct way to do it (the nearest high after crossing 2 Mascos)?
You give it Time and you get a schift.
Suppose you know the time of zero bar.
Some events have passed,
The situation has changed, and you want to check the position of the bar with this time compared to the zero bar.
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
This is where I recently answered an analogous question.
https://www.mql5.com/ru/forum/109048/page11
-Look it up.
In your case, you could probably go like this:
Gentlemen, please explain the difference between
fromI don't understand what iBarShift is and what it does
This is where I recently answered an analogous question.
'A question for connoisseurs'.
-See this.
In your case, you could probably go like this:
Thanks, rid!
It worked for me, I did it like this.
Gentlemen, could you please explain the difference between
fromI don't understand what iBarShift is and what it does
I've read the reference, but I do not understand what it says: "The function returns the shift of the bar" - what does it mean? If I've read the first one, it simply means the number of candlesticks and the second one means some displacement. I think I need the nearest high after some conditions, the first case will not work because I may not see max 10 bars (and may not see max 20 or 30 either), how should I describe it correctly (the nearest high for example after crossing 2 Mascos)?
I've read the help, but I don't understand what it says, "The function returns the shift of the bar" - what does it mean? If I've read the first one, it simply means the number of candlesticks, and the second one means some displacement. I think I need the nearest high after some conditions, the first case will not work because I may not see max 10 bars (and may not see max 20 or 30 either), what will be the right way to do it (the nearest high after 2 Mascos crossing for example)?
ibarshift shows in which bar from the beginning of the chart the n-th second time
I've read it, but I don't understand what it says: "The function returns the bar shift" - what does it mean? If I've read the first one, it simply means the number of candlesticks, but the second one means some displacement. I think I need the nearest high after some conditions, the first case will not work because I may not see max 10 bars (and may not see max 20 or 30 either), what is the correct way to do it (the nearest high after crossing 2 Mascos)?
You give it Time and you get a schift.
Suppose you know the time of zero bar.
Some events have passed,
The situation has changed, and you want to check the position of the bar with this time compared to the zero bar.
This is where you need this function.
Dimoncheg
I'm a customer of this section myself)
======================
I have another question, how to divide the beam ZZ in half to calculate its level and make a fix at this level?
Dimoncheg
I'm a customer of this section myself)
======================
I have another question, how to divide the beam ZZ in half that would calculate its level and make a fix at this level?
The zigzag is not calculated at the last point. As a rule, it cannot be fixed at this level either.