[ARCHIVE] Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 3. - page 601

 
zxc:

opening price - double
yes, without structures you have to make everything 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.

   Symb=Symbol();
   total=OrdersTotal();
   string TodayDate=TimeToStr(TimeCurrent(),TIME_DATE);
   if (total>0)
   { // ------- D.1. Start 
      for (i=0; i<=total; i++)
      { // ------ D.2. Start
         if (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. Start
         if (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
 
paladin80:

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);

 
Ivn:

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("вызов функции скриншот");
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(" скриншотсделан ");}
Look elsewhere -- the function works.
 
Roll:
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?

 
Ivn:


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.
 
Roll:

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.

 
Ivn:


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.
Reason: