I can't find an answer to my question in the tutorial, so I decided to ask it here. My strategy allows only one trade on 1 bar. In caseof D1I made a check of the current day with the opening day of the order (see below). How can I make a check on H4, H1 or in general for any other timeframe? If this topic has already been covered somewhere, I would be very grateful for a link. Regards.
Symb=Symbol();
total=OrdersTotal();
string TodayDate=TimeToStr(TimeCurrent(),TIME_DATE);
if (total>0)
{ // ------- D.1. Start for (i=0; i<=total; i++)
{ // ------ D.2. Startif (OrderSelect(i,SELECT_BY_POS,MODE_TRADES)==true)
{ string OrderDate=TimeToStr(OrderOpenTime(),TIME_DATE);
if (OrderSymbol()==Symb && TodayDate==OrderDate)
{ Comment ("Today order for ",Symbol()," was opened");
Sleep(60000); return(0); }
}
} // ------ D.2. End
} // ------- D.1. End
I can't find an answer to my question in the tutorial, so I decided to ask it here. My strategy allows only one trade on 1 bar. In caseof D1I made a check of the current day with the opening day of the order (see below). How can I make a check on H4, H1 or in general for any other timeframe? If this topic has already been covered somewhere, I would be very grateful for a link. Sincerely.
Symb=Symbol();
total=OrdersTotal();
string TodayDate=TimeToStr(TimeCurrent(),TIME_DATE);
if (total>0)
{ // ------- D.1. Start for (i=0; i<=total; i++)
{ // ------ D.2. Startif (OrderSelect(i,SELECT_BY_POS,MODE_TRADES)==true)
{ string OrderDate=TimeToStr(OrderOpenTime(),TIME_DATE);
if (OrderSymbol()==Symb && TodayDate==OrderDate)
{ Comment ("Today order for ",Symbol()," was opened");
Sleep(60000); return(0); }
}
} // ------ D.2. End
} // ------- D.1. End
I can't find an answer to my question in the tutorial, so I decided to ask it here. My strategy allows only one trade on 1 bar. In caseof D1I made a check of the current day with the opening day of the order (see below). How can I make a check on H4, H1 or in general for any other timeframe? If this topic has already been covered somewhere, I would be very grateful for a link. Sincerely.
why the screenshots - prescribed in the EA algorithm, do not show the indicators by which the algorithm is implemented, and there is a window for the indicator?
why the screenshots - prescribed in the EA algorithm, do not show the indicators by which the algorithm is implemented, and there is a window for the indicator?
I use it for testing, from time to time it makes skinshots, sometimes not (lately it does not)).
The EA uses ADX of the same period to make a decision - just different candles, I just need a graphical representation of this indicator to understand why it makes trades when it should not - to test the algorithm.
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.
opening price - double
I can't find an answer to my question in the tutorial, so I decided to ask it here. My strategy allows only one trade on 1 bar. In caseof D1I made a check of the current day with the opening day of the order (see below). How can I make a check on H4, H1 or in general for any other timeframe? If this topic has already been covered somewhere, I would be very grateful for a link. Regards.
I can't find an answer to my question in the tutorial, so I decided to ask it here. My strategy allows only one trade on 1 bar. In caseof D1I made a check of the current day with the opening day of the order (see below). How can I make a check on H4, H1 or in general for any other timeframe? If this topic has already been covered somewhere, I would be very grateful for a link. Sincerely.
I can't find an answer to my question in the tutorial, so I decided to ask it here. My strategy allows only one trade on 1 bar. In caseof D1I made a check of the current day with the opening day of the order (see below). How can I make a check on H4, H1 or in general for any other timeframe? If this topic has already been covered somewhere, I would be very grateful for a link. Sincerely.
Use iTime function: https://docs.mql4.com/ru/series/iTime
and compare OrderOpenTime() with iTime(Symbol(), PERIOD_H1, 0) in your loop
why the screenshots - prescribed in the EA algorithm, do not show the indicators by which the algorithm is implemented, and there is a window for the indicator?
Code
bool TakeScreenShot(string type)
{
Print("screenshotcall ");
int count = 1;
if(!GlobalVariableCheck("ssc"))
{
GlobalVariableSet("ssc",1);
count = 1;
}
else
{
count = GlobalVariableGet("ssc") + 1;
GlobalVariableSet("ssc",count);
}
string filename = "MyEA\\\" + "MyEA_" + Symbol() + "_" + type + "_" + DoubleToStr(count,0) + ".gif";
WindowScreenShot(filename,640,480);
Print(" screenshot done ");
return(0);
why the screenshots - prescribed in the EA algorithm, do not show the indicators by which the algorithm is implemented, and there is a window for the indicator?
code
Look elsewhere - the function works.
Yes, I know the function works, here is the result
there is an indicator window at the bottom, but not the indicator itself, why?
yes, I know the function works, here is the result
there is an indicator window at the bottom but not the indicator itself, why?
Try it on a demo account.
Try it on a demo account.
I use it for testing, from time to time it makes skinshots, sometimes not (lately it does not)).
The EA uses ADX of the same period to make a decision - just different candles, I just need a graphical representation of this indicator to understand why it makes trades when it should not - to test the algorithm.
I use it for testing, from time to time it makes skinshots, sometimes not (lately it does not)).
I need a graphical representation of this indicator to understand why it makes trades when it should not - to test the algorithm.
Check it on the demo, not in the tester.