Questions from Beginners MQL5 MT5 MetaTrader 5 - page 891

 
Sile Si:

Does not fit, modify by ATR What other checks can be done for this error? All possible. In mt4 there isSTOPLEVEL, but what is here?

I do not know what to do on the exchange. I do not have access to the real exchange.


Added: always print as much information as possible when making an error: Bid, Ask, Last, PriceCurrent, PriceOpen, TakeProfit (current and estimated) ...


Added, added.

Universal function - called after any trade operation

//+------------------------------------------------------------------+
//| Print CTrade result                                              |
//+------------------------------------------------------------------+
void PrintResult(CTrade &trade,CSymbolInfo &symbol,CPositionInfo &position)
  {
   Print("Code of request result: "+IntegerToString(trade.ResultRetcode()));
   Print("code of request result as a string: "+trade.ResultRetcodeDescription());
   Print("Deal ticket: "+IntegerToString(trade.ResultDeal()));
   Print("Order ticket: "+IntegerToString(trade.ResultOrder()));
   Print("Volume of deal or order: "+DoubleToString(trade.ResultVolume(),2));
   Print("Price, confirmed by broker: "+DoubleToString(trade.ResultPrice(),symbol.Digits()));
   Print("Current bid price: "+DoubleToString(symbol.Bid(),symbol.Digits())+" (the requote): "+DoubleToString(trade.ResultBid(),symbol.Digits()));
   Print("Current ask price: "+DoubleToString(symbol.Ask(),symbol.Digits())+" (the requote): "+DoubleToString(trade.ResultAsk(),symbol.Digits()));
   Print("Broker comment: "+trade.ResultComment());
   Print("Price of position opening: "+DoubleToString(position.PriceOpen(),symbol.Digits()));
   Print("Price of position's Stop Loss: "+DoubleToString(position.StopLoss(),symbol.Digits()));
   Print("Price of position's Take Profit: "+DoubleToString(position.TakeProfit(),symbol.Digits()));
   Print("Current price by position: "+DoubleToString(position.PriceCurrent(),symbol.Digits()));
   DebugBreak();
  }


You must also update price of CSymbolInfo class object just before modification.

 
Vladimir Karputov:

What should I pass in the parameters?

if(_LastError>0){PrintResult();}
'PrintResult' - wrong parameters count A_1.mq5 901 34

 
Sile Si:

What to pass in the parameters?

It says: three object classes Ctrade, CSymbolinfo and Cpositioninfo
 
Vladimir Karputov:

What to write, specifically for sell ?

 
Sile Si:

What to write, specifically for sell ?

I gave two checks above: check the calculated TakeProfit level with the current TakeProfit and with the current price.
 

Hello.

I am running the built-in "Fractals" indicator from the Terminal Indicators / Bill Williams / Fractals. I get the following picture


Line colour and style in the tab "Parameters".

I start the same indicator from custom indicators with an open source (Indicators/Example/Fractals). I see the following settings:


Settings on the "Colours" tab with additional unnecessary information.

How can I adjust style/colour of lines in custom indicator as in standard indicator?

 
Sergey Savinkin:

Hello.

I am running the built-in "Fractals" indicator from the Terminal Indicators / Bill Williams / Fractals. I get the following picture


Line colour and style in the tab "Parameters".

I start the same indicator from custom indicators with an open source (Indicators/Example/Fractals). I see the following settings:


Settings on the "Colours" tab with additional unnecessary information.

How can I adjust style/colour of lines in custom indicator as in standard indicator?

Same as everywhere else: two clicks on a colour

 
Vladimir Karputov:
Same as everywhere else: two clicks on a colour

This is understandable. But I need the window to appear as in the standard indicator. I do not need DRAW_ARROW line style. I make my own indicator. Fractals for example.

 
Vladimir Karputov:
I gave two checks above: check the calculated TakeProfit level with the current TakeProfit and with the current price.

A question about the function call.

What should I write for sell inPrintResultfunction's parameterswhen calling it after unsuccessful modification of tp?

 
Hi. I have a robot written in mql5 , can i use it on mobile versions of mt5 ? thanks