Questions from Beginners MQL5 MT5 MetaTrader 5 - page 900

 
Sile Si:

No doubt the advisor attached to si modifies vtbr

If you attach an EA to vtbr it does not modify si, it only works on its own instrument


Do you have any explanation for this?

There is no modification in the code except this one:

Attach log lines that show modification (don't spare lines - take + 3 from top and bottom)


Added.

And show OnInit().

 
Vladimir Karputov:

Attach log lines that show the modification (don't spare the lines - take + 3 at the top and bottom)


Added.

And show OnInit().

Situation: I delete T/R manually, EA puts it again.

NDP

int OnInit()
  {
   if(!MQLInfoInteger(MQL_TRADE_ALLOWED))
     {
      //Alert("Automated trading is forbidden in the program settings for ",__FILE__);
      return(false);
     }
   входить=входить_;
   handle_iCustom=iATR(Symbol(),ATRtimeframe,ATRper);
   if(handle_iCustom==INVALID_HANDLE)
     {
      //--- tell about the failure and output the error code 
      PrintFormat("Failed to create handle of the iCustom indicator for the symbol %s/%s, error code %d",
                  m_symbol.Name(),
                  EnumToString(Period()),
                  GetLastError());
      //--- the indicator is stopped early 
      return(INIT_FAILED);
     }

//
   handle_iCustom_2=iATR(Symbol(),ATRtimeframeStep,ATRperStep);

   if(handle_iCustom_2==INVALID_HANDLE)
     {
      //--- tell about the failure and output the error code 
      PrintFormat("Failed to create handle of the iCustom indicator for the symbol %s/%s, error code %d",
                  m_symbol.Name(),
                  EnumToString(Period()),
                  GetLastError());
      //--- the indicator is stopped early 
      return(INIT_FAILED);
     }
//

   handle_iMA=iMA(Symbol(),Time_Frame_MA,Period_MA,0,MODE_SMA,PRICE_CLOSE);
//--- if the handle is not created 
   if(handle_iMA==INVALID_HANDLE)
     {
      //--- tell about the failure and output the error code 
      PrintFormat("Failed to create handle of the iMA indicator for the symbol %s/%s, error code %d",
                  Symbol(),
                  EnumToString(Period()),
                  GetLastError());
      //--- the indicator is stopped early 
      return(INIT_FAILED);
     }

   m_hline_name_buy=Symbol()+" "+m_hline_name_buy;
// m_hline_name_sell=Symbol()+" "+m_hline_name_sell;

   HLineCreate(0,m_hline_name_buy,0,0.0,clrLime,2);
//---
//---
   if(InpLot<=0.0)
     {
      Print("The \"Lot\" can't be smaller or equal to zero");
      return(INIT_PARAMETERS_INCORRECT);
     }
//---
   if(!m_symbol.Name(Symbol())) // sets symbol name
      return(INIT_FAILED);
   RefreshRates();

   string err_text="";
   if(!CheckVolumeValue(InpLot,err_text))
     {
      Print(err_text);
      return(INIT_PARAMETERS_INCORRECT);
     }
//---
   m_trade.SetExpertMagicNumber(m_magic);
//---
   if(IsFillingTypeAllowed(SYMBOL_FILLING_FOK))
      m_trade.SetTypeFilling(ORDER_FILLING_FOK);
   else if(IsFillingTypeAllowed(SYMBOL_FILLING_IOC))
      m_trade.SetTypeFilling(ORDER_FILLING_IOC);
   else
      m_trade.SetTypeFilling(ORDER_FILLING_RETURN);
//---
   m_trade.SetDeviationInPoints(m_slippage);
//--- tuning for 3 or 5 digits
   int digits_adjust=1;
   if(m_symbol.Digits()==3 || m_symbol.Digits()==5)
      digits_adjust=10;
   m_adjusted_point=m_symbol.Point()*digits_adjust;
   ExtZeroLevel=InpZeroLevel*m_adjusted_point;
   ExtTrailingStop=InpTrailingStop*m_adjusted_point;
   ExtTrailingStep=InpTrailingStep*m_adjusted_point;
//-
   ExtTakeProfit=TakeProfit*m_adjusted_point;
   ExtSL=StopLoss*m_adjusted_point;
   ExtStep=InpStep*m_symbol.Point();
//---
   return(INIT_SUCCEEDED);
  }
 
Sile Si:

Situation: I delete T/P manually, the EA is put back on.

Please give information: full text of EA, on which server you connect, how much balance, what build of terminal. I would like to check it.

Only one thing: if you test NOT on MetaQuotes-Demo, but on exchange server - here without me.

 
Vladimir Karputov:

Please give me some information: the full text of the EA, which server you connect to, how much the balance is, which build of the terminal. I would like to check it.

Only one thing: if you are testing NOT on MetaQuotes-Demo, but on an exchange server - here without me.

This is FORTS. And if the problem occurs only in one place and with a particular futures, maybe it is easier to go through the debugger? I'm sorry, I got confused. It seems that the debugger does not work on Expert Advisors.

 
Sergey Savinkin:

This is FORTS. And if the problem occurs only in one place and with a particular futures, maybe it's easier to go through the debugger?

 
Sile Si:

Situation: I delete the T/P manually, the advisor puts it back in.

Please run this code:ListPositions.

Check position type (BUY or SELL) and symbol name match. Also need to specify the NAME of the trading server and the BILD of the terminal.

 
Vladimir Karputov:

Please run this code:ListPositions.

Check position type (BUY or SELL) and symbol name match. You also need to specify trading server NAME and BILD of the terminal.

Result:

rn

open-broker build last, 1881. On vtbr sets T/R=0 and on someone else's instrument si, sets T/R which should be on vtbr.

Vladimir Karputov:. On the exchange server - here without me.

Who to address?

 
Sile Si:

Result:

Open-broker build last.

Who do I contact?

I have an account at FORTS bx. Can you send me the EA and its settings? If you do not want to "light up" the logic of the EA, you can send me any cut version, as long as you can simulate an error. And forts will close in two hours.

And a detailed description of how to simulate an error.
 
Sergey Savinkin:

I have a FORTS bx account. Can you send me the EA and the settings. If you don't want to make the EA's logic "light", you can throw in any cut version, as long as you can simulate an error. And Forts will close in two hours.

What to hide, entrance by MA, averaging) Look at the PM, please.

There's a lot of extra stuff inside that's left over from working on a hedge account.

 
Sile Si:

Result:

open-broker build last, 1881. On vtbr puts T/P=0 and on someone else's tool, si, puts T/P which should be on vtbr.

Who do I contact?

Thanks for the clarification.

If you use a code that is very similar to my examples, please send me your EA. I am now logging trades in more detail. I will look at it and fix the code. I will check it later.

Reason: