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

 
Roman.:

Guys, a hint... Here is the code section where market entry conditions are calculated. Why with given values of timeframes obtained during optimization...

Well, I'm controlling a new bar this way. I have not noticed any problems similar to yours. May they be corrected?

int start()
{
   static datetime PrevTime=0;   // Время открытия предпоследнего бара

   if (PrevTime==0) PrevTime=Time[0];  // При первом запуске текущий бар пропускаем
   if (Time[0]<=PrevTime) return(0);   // Контроль времени открытия нового бара

------
    
   PrevTime=Time[0]; // Запоминаем время открытия нулевого бара

   return(0);
  }

PS. Thanks for the information on the optimisation!

 

drknn:

Если OrderClosePrice()==OrderStopLoss() - то стопудово ордер закрыт по лосс-приказу.

That's right. But if there has been slippage, they are not equal for shit.
 
snail09:

Well, I control the new bar this way. I haven't noticed any problems like yours. Can they correct it?

int start()

PS. Thanks for the information on optimization!


Yes he has another problem: on every new H4 bar the entry conditions from the days are repeated.
 
PapaYozh:

He has a different problem: on each new H4 bar the entry conditions from the days are repeated.

Well then I don't get it :-(

 

I can't find anything useful in search engine.

I can't find anything useful in search or maybe somebody will suggest something.

Thank you

 
Hello, Do you know if there are any Expert Advisors that use the following principle: Trades are opened by crossing the highs and lows of the previous day. After opening a deal a trailing stop is triggered or stops are set on a 15-minute parabolic. I would also like to ask if there are any Expert Advisors, scripts or indicators with the following parameters: some traders trade manually, it would be nice if Expert Advisors or indicators would send SMS to their mobile phones beside the sound signal. Then there would be no need to constantly sit in front of the monitor. Thank you!
 
Vinin:


It makes sense to make the signal_period variable global and assign a value to it in init()

And change the control of the new bar


Victor, thank you, your code helped me, at least when it comes to entering the market ONLY by the open of a daily candle and no matter what TF the test is on ... Entry as it is in the variables

extern string A4 = "Таймфрейм и параметры технических индикаторов";
extern int s_signal_period=7;
extern int t_trend_period =7;

i.e. next.

int init(){


    IsExpertStopped = false;
   if (!IsTradeAllowed())
   {
      Comment("Необходимо разрешить советнику торговать");
      IsExpertStopped = true;
      return (0);
   }
      
   if (!IsTesting())
   {
      if (IsExpertEnabled())
      {
         Comment("Советник запустится следующим тиком");
      }
      else 
      {
         Comment("Отжата кнопка \"Разрешить запуск советников\"");
      }
   }
   //считаем таймфреймы, на которых определяем глобальный тренд по АДХ-trend_period и точку входа по пробою фрактала на signal_period 
    int trend_period=GetPeriod(t_trend_period);
    int signal_period=GetPeriod(s_signal_period); 
    
  

int start()
{
   //считаем таймфреймы, на которых определяем глобальный тренд по АДХ-trend_period и точку входа по пробою фрактала на signal_period 
    int trend_period=GetPeriod(t_trend_period);
    int signal_period=GetPeriod(s_signal_period); 
    
   if(iTime(Symbol(),signal_period,0) == prevtime)   return(0);  //ждем нового бара
   prevtime = iTime(Symbol(),signal_period,0);                   //если появился новый бар , включаемся
  
  // if(Time[0] == prevtime)   return(0);  //ждем нового бара
  // prevtime = Time[0];                   //если появился новый бар , включаемся

Although on market exiting by stop or take, there are still some differences, but at the same time I do not exclude that this is a feature of the tester, i.e., as you just wrote, the lower is the used timeframe, the more clearly stop and take levels are fulfilled. The charts in the tester are the same regardless of the timeframe being charged, but differences in stop and take levels are present... Here are the screens - the first test on H4, the second one - on the daily timeframe, the third one - on H1... It looks like it should be... Differences by time of execution are marked in red only for the first ones I met... Looks like it should be so...

Н4:

Execution of the stop on the days:

On H1:

I.e., the smaller the TF used, the sicker the stop execution is in the tester, so it turns out...if I'm not mistaken...

Comment, guys, who knows exactly...

Victor, thank you from the bottom of my heart, for the answer to my question on this topic.

 
Roman.:


Victor, thank you, your code helped me, at least when it comes to market entry ONLY on the open of a daily candle and no matter what TF is tested ... Entry as it is in the variables

I.e. further.

Although there are still some differences in exiting the market by stop or take, but at the same time, I do not exclude that this is a feature of the tester, i.e., as you just wrote, the lower the used timeframe is, the more clearly stop and take levels are fulfilled. The charts in the tester are the same regardless of the timeframe being charged, but differences in stop and take levels are present... Here are the screens - the first test on H4, the second one - on the daily timeframe, the third one - on H1... It looks like it should be... Differences by time of execution are marked in red only for the first ones I met... Looks like it should be so...

Н4:

Execution of the stop on the days:

On H1:

I.e., the smaller the TF used, the sicker the exact execution of stops in the tester, so it turns out...if I'm not mistaken...

Comment, guys, who knows exactly...

Victor, thank you from the bottom of my heart, for your reply to my question on this topic.


There is not much to comment on. You have managed to draw the right conclusion on your own
 
Vinin:

I have nothing much to comment on. You've managed to draw the right conclusion yourself


I see. I'm just saying that the output is more accurate using stops(takeout...:-)), with a smaller TF used...

Thank you, Victor.

With similar question (on other owl - on my variant of Avalanche... :-)) I have addressed earlier, in this branch, to find page - now there is no desire, to me PapaYozh recommended to look at time of transactions and compare, at those or other values of these variables..., that also is RIGHT. You gave a specific recommendation, what and which variant of the code to try - I figured it out, thank you.

 

snail09
:

...

PS. Thank you for the information on optimisation!


Make use of it, remembering... (just kidding) that "everyone" is "so-and-so" (A. Elder)... SOUL... :-)))


Reason: