Questions from Beginners MQL5 MT5 MetaTrader 5 - page 1108

 
Сергей Таболин:

Doesn't it bother you that SL, TP and price are the same!

I'm just starting to learn MQL5. I wrote this EA at the same time when I was reading the article and I think the author of the article

It looks like the author of the article made a mistake in the code! I downloaded the code of the author of the article and after running it in the tester, it got absolutely the same result!

Here is a link to the article if you are interested!

https://www.mql5.com/ru/articles/100

Пошаговое руководство по написанию MQL5-советников для начинающих
Пошаговое руководство по написанию MQL5-советников для начинающих
  • www.mql5.com
Эта статья предназначена для начинающих, для тех, кто хочет научиться написанию простых советников на новом языке MQL5. Сначала мы определимся с тем, что требуется от нашего советника, а затем приступим к написанию того, каким образом он будет это делать. 1. Торговая стратегия Он будет следить за некоторыми индикаторами и при определенном...
 

Let me ask you one more time.

int OnCalculate(const int rates_total,
                const int prev_calculated,
                const datetime &time[],
                const double &open[],
                const double &high[],
                const double &low[],
                const double &close[],
                const long &tick_volume[],
                const long &volume[],
                const int &spread[])
  {

Over here.

const double &open[],

Can I slip in something of my own? Say open/2

 
Good afternoon, gentlemen. The following problem has arisen. The visualizer in the tester duplicates the indicator windows. Specifically, I have an Expert Advisor that works with 3 indicators, one of which is a moving window. The other 2 indicators are displayed in separate panels. The problem is that in the visualizer and therefore in debugging these panels are doubled. During the test without visualization everything goes smoothly. Nuances. The test runs on a custom symbol (imported quotes, no formula). When testing with visualization/debugging on one of the indices at a certain point an error zero divide appears, while testing without visualization or simply overlaying the indicator on the same chart, this problem does not occur, especially as it is handled. Who knows, would be grateful for help
 
Guys Hi All, can you tell me if cuskalp can be linked to mt5. broker opening. Thank you!
 

Can you tell me how to set the spread for testing in mt5?

 
Roman Sharanov:

Can you tell me how to set the spread for testing in mt5?

I can't. Would it be better to test on real ticks?

 
Alexey Viktorov:

I don't know such brokers on mt5. Maybe it would be better to test on real ticks?

I just know that testing in mt5 is incomparably better than mt4, so I wanted to test the robot in mt5, but it needs a very small spread, I don't know such brokers on mt5

 

Greetings!

I am creating an input field, I am writing "double" in the input parameters

input double TralingStop = 15;

int OnInit()
 {
  EditCreate(0,"TR",0,0,0,X,Y,(string)TralingStop,true);

As a result, if I enter an integer number in mt4, it will be displayed:


I get a fractional number in mt5:


If I enter a fractional number, there will be no problem - everything works in feng shui :)


Question: How do I get a display in mt5 as an integer?

 
Vitaly Muzichenko:

Greetings!

I am creating an input field, I am writing "double" in the input parameters

As a result, if I enter an integer number in mt4, it will be displayed:


I get a fractional number in mt5:


If I enter a fractional number, there will be no problem - everything works in feng shui :)


Question: how do I get a mapping in mt5 as an integer?

DoubleToString(TralingStop,0);

DoubleToString

Converts a numeric value to a text string.

string  DoubleToString( 
   double  value,      // число 
   int     digits=8    // кол-во знаков после запятой 
   );
 
Vladimir Karputov:

DoubleToString(TralingStop,0);

DoubleToString

Converts a numeric value to a text string.

Then I don't get a fractional number.

I guess I need something like that:

EditCreate(0,"TR",0,0,0,X,Y, isInteger(TralingStop) ? DoubleToString(TralingStop,0) : DoubleToString(TralingStop,1),true);
Reason: