Questions from Beginners MQL5 MT5 MetaTrader 5 - page 490

 
Hello dear friends !!! Everyone decides for himself. Will Forex be his main source of income or just a game. Of course, most traders are looking for profitable trading. They've already searched all over the Internet looking for something... ))) And I'm going all the way back in 2008. It was the only time I got relaxed, when I bought the strategy. I bought it in 2013. I started to earn real money on the stock market from that time. Thus, earning or not earning forex is a question that everyone can answer only to himself. You know, I'll give you some advice. Who will accept it, and someone will ignore it. You have to live Forex, and you have to love it. And not just want to use it to make easy money. You can make easy money at the factory. You don't have to think there. That's where the management thinks for you. All you have to do is work eight hours. I know what you're thinking. Look at the strategy I'm using. And you tell yourself. Whether or not you can make money with it. ***
Files:
 
I will help in any way I can. I, too, have had help from experienced traders in my time. I have been trading since 2008. I don't take money from people because I take it (the green stuff) from the market. It's enough for me!
 
FXMigor:
I will help in any way I can. I, too, have had help from experienced traders in my time. I have been trading since 2008. I don't take money from people because I take it (the green stuff) from the market. I do not take money from people, it's the money I take from the market. That's enough for me!
I do not take any money from them (the green ones), that's enough for me! I have no need to advertise here, I will be banned for advertising.
 
I see ))))
 

Good evening,

Please advise on a general question.

TheExpert Advisor Ais written. Inside it, only the indicator B is written. In the onTick section the calculated indicator value is saved in the b1 variable.

So every time new price appears, the indicator will be recalculated and b1 will be updated?

 
kashi_ann:

Good evening,

Please advise on a general question.

TheExpert Advisor Ais written. Inside it, only the indicator B is written. In the onTick section the calculated indicator value is saved in the b1 variable.

So every time new price appears, the indicator will be recalculated and b1 will be updated?

Yes
 
kashi_ann:

Good evening,

Please advise on a general question.

TheExpert Advisor Ais written. There is only indicator B inside it. In the onTick section the calculated indicator value is saved in the b1 variable.

So every time new price appears, the indicator will be recalculated and b1 will be updated?

It depends on how the indicator is written. If it has the logic of the zero candle refreshing, then yes. If not, then the indicator will be updated only with the arrival of a new candle. The variant of the total recalculation of the indicator on every tick is also possible.
 

Good day!

Dear forum members, I would like to know what exactly is meant by a "tick" in metatrader4. Is it a Bid or Ask price change? Or it makes no difference whether the tick handler is triggered in both cases?

 
Vasua:

Good day!

Dear forum members, I would like to know what exactly is meant by a "tick" in metatrader4. Is it a Bid or Ask price change? Or it makes no difference whether the tick handler is triggered in both cases?

In either case. A tick is a price change.
 
Vasua:

Good day!

Dear forum members, I would like to know what exactly is meant by a "tick" in metatrader4. Is it a Bid or Ask price change? Or there is no difference and in both cases the tick handler will work?

OnTick misses 50-70% of price changes (last) comparing to OnBookEvent. I don't quite understand who needs it and why they need it at all. The documentation says right away that several ticks can come to the terminal simultaneously and create only one ontick event.

In theory, it's more reasonable to use OnBookEvent and then filter out the necessary changes.

But I have a problem here too. It looks like this:

void OnBookEvent(const string &symbol)
  {
   if(symbol==_Symbol) // Нужный символ
     { 
      MqlTick mtick[];
      CopyTicks(_Symbol,mtick,COPY_TICKS_ALL,0,1); // Скопировали структуру с последним тиком
      lastprice=mtick[0].last; // Взяли из него последнюю сделку

      if(lastprice!=lastprice1) // Сравнили с предыдущим тиком
        {
//Записали всю информацию в лог
logger.write("Время: "+(string)mtick[0].time+" Bid: "+(string)mtick[0].bid+" Ask: "+(string)mtick[0].ask+" Last: "+(string)mtick[0].last+" Volume: "+(string)mtick[0].volume+" Flags: "+(string)mtick[0].flags);
// "тик изменил цену последней сделки"
if (mtick[0].flags & TICK_FLAG_LAST) {logger.write("Last: "+(string)mtick[0].last+" Volume: "+(string)mtick[0].volume+" Flags: "+(string)mtick[0].flags);}
lastprice1=lastprice;
}
}
}

The result is about the following:

notice:|:12:06:40    Время: 2016.01.06 12:06:39 Bid: 75336 Ask: 75339 Last: 75337 Volume: 3 Flags: 2
notice:|:12:06:41    Время: 2016.01.06 12:06:40 Bid: 75337 Ask: 75341 Last: 75340 Volume: 25 Flags: 2
notice:|:12:06:42    Время: 2016.01.06 12:06:41 Bid: 75336 Ask: 75339 Last: 75339 Volume: 1 Flags: 24
notice:|:12:06:42    Last: 75339 Volume: 1 Flags: 24
notice:|:12:06:44    Время: 2016.01.06 12:06:43 Bid: 75337 Ask: 75338 Last: 75338 Volume: 1 Flags: 4
notice:|:12:06:46    Время: 2016.01.06 12:06:45 Bid: 75329 Ask: 75331 Last: 75330 Volume: 5 Flags: 24
notice:|:12:06:46    Last: 75330 Volume: 5 Flags: 24
notice:|:12:06:50    Время: 2016.01.06 12:06:49 Bid: 75328 Ask: 75332 Last: 75328 Volume: 4 Flags: 24
notice:|:12:06:50    Last: 75328 Volume: 4 Flags: 24
notice:|:12:06:52    Время: 2016.01.06 12:06:51 Bid: 75327 Ask: 75329 Last: 75327 Volume: 127 Flags: 24
notice:|:12:06:52    Last: 75327 Volume: 127 Flags: 24
notice:|:12:06:53    Время: 2016.01.06 12:06:52 Bid: 75328 Ask: 75331 Last: 75330 Volume: 3 Flags: 2
notice:|:12:06:54    Время: 2016.01.06 12:06:53 Bid: 75328 Ask: 75329 Last: 75331 Volume: 1 Flags: 2
notice:|:12:06:55    Время: 2016.01.06 12:06:54 Bid: 75325 Ask: 75326 Last: 75325 Volume: 1 Flags: 24
notice:|:12:06:55    Last: 75325 Volume: 1 Flags: 24
notice:|:12:06:56    Время: 2016.01.06 12:06:55 Bid: 75321 Ask: 75323 Last: 75322 Volume: 2 Flags: 4
notice:|:12:06:57    Время: 2016.01.06 12:06:56 Bid: 75321 Ask: 75323 Last: 75323 Volume: 4 Flags: 24
notice:|:12:06:57    Last: 75323 Volume: 4 Flags: 24

I.e. last is different but the flag is notTICK_FLAG_LAST.

What am I doing wrong?

Reason: