Questions from Beginners MQL5 MT5 MetaTrader 5 - page 1141

 
Vladimir Karputov:

Yes. Now try starting at the top of the chart and dragging the crosshairs down ...

(1250,761-1193,590)/1250,761*100 = 4,570897237762


 
Igor Zakharov:

(1250,761-1193,590)/1250,761*100 = 4,570897237762

Only now there is a nuance: since we started pulling higher, and finished lower - the percentages on the graph are shown with a "-" sign. For me it is more informative.

 
Vladimir Karputov:

Well, I guess you haven't forgotten there's a calculator, have you? Can't you at least calculate something yourself?


Added: If the calculator is too heavy, I can quote again:

Terminal: The Crosshair tool now shows the distance between price levels not just in pips, but also as a percentage:

There is no problem with the calculator and never has been.

However, "Percentage" is a fraction of something in relation to a whole predetermined value = 100%.

So, the distance between price levels as a percentage relative to what?

https://ru.wikipedia.org/wiki/Процент

 
Anzhela Sityaeva:

So, the distance between price levels as a percentage of what?

Relative to the initial price (where you're dragging the crosshair from).

 
Igor Zakharov:

relative to the starting price (where you drag the crosshairs from). it worked out for me, see above.

If where you drag from = 100% and where you stop 0%, then the result = 100%
 
Anzhela Sityaeva:
If where you drag from = 100% and where you stop 0%, then the result = 100%

I hope your customers aren't reading this...

0% where 0 is absolute
 
Igor Zakharov:

I hope your customers aren't reading this...

0% is where 0 is absolute.

Yes... Friday, it's a good thing I'm not alone. Although what easier way to say it was to say that 100% is taken as the price value from where the measurement starts.

 

Please help to finalise the EA on MT5))))

Added selection of fix lot and risk lot... In the tester everything works fine, but in the terminal, when you select a risk lot, it throws the EA off the chart...

   double dfg, ifg;
   dfg = AccountInfoDouble(ACCOUNT_MARGIN_FREE);
   ifg = InpVolumeLotOrRisk;
   switch(IntLotOrRisk)
     {
      case MY_FIXLOT:
         InpLots= InpLotsfix;
         break;

      case MY_RISKLOT:
         InpLots= dfg*ifg/25000;    // FreeMargin * %риска) / 100 * 250(средняя цена лота)
         break;

     }

What's wrong with this bit of code?))

P.S. Just don't start criticizing the risk formula for a few pages - I'm quite happy with such a variant) The main thing is that the lot itself goes up for the balance)

 
Vlad Svetlov:

Please help to finalise the EA on MT5))))

Added selection of fix lot and risk lot... In the tester everything works fine, but in the terminal, when you select a risk lot, it throws the EA off the chart...

What's wrong with this bit of code?))

P.S. Just do not start to criticize the risk formula for a few pages - I'm quite happy with such a variant) The main thing that the lot itself rises behind the balance)

obtained as a result of mathematical calculations lot should be checked and rounded if necessary.

I use a function:

//+------------------------------------------------------------------+
//| Lot Check                                                        |
//+------------------------------------------------------------------+
double LotCheck(double lots,CSymbolInfo &symbol)
  {
//--- calculate maximum volume
   double volume=NormalizeDouble(lots,2);
   double stepvol=symbol.LotsStep();
   if(stepvol>0.0)
      volume=stepvol*MathFloor(volume/stepvol);
//---
   double minvol=symbol.LotsMin();
   if(volume<minvol)
      volume=0.0;
//---
   double maxvol=symbol.LotsMax();
   if(volume>maxvol)
      volume=maxvol;
   return(volume);
  }

after calling it, you should check what it returned - if "0.0" -> it means that the calculated lot is very small.

 

Salud to all.

Noticed this anomaly when drawing the standard zigzag from the Examples folder.

The only difference is the start date of the test. Perhaps someone knows the cause of this distortion and how to fix it ?

Reason: