Questions from Beginners MQL5 MT5 MetaTrader 5 - page 337

 
Tapochun:
It's not the robot... It works without any errors. The structure of trade result is MqlTradeResult, it is the second parameter in function OrderSend() look in documentation. The code was written using OOP, I'm not familiar with it... You have to find a method that sends a trade request using OrderSend() and after it call Print( result.retcode ) where result is an object of MqlTradeResult structure.

Made it work.

It is done like this

MqlTradeResult result;

 trade.Result(result)

Print(result.retcode)

trade is an object of class CTrade.

The code returns 10030 (Unsupported balance order execution type specified)

What does it mean?

 
Maxi-M:

Made it work.

It is done like this

trade is an object of class CTrade.

The code returns 10030 (Unsupported balance order execution type specified)

What does it mean?

Have you tried to open a demo account on MetaQuotes-Demo server? If not, try it and if everything is OK, write to Service Desk and complain that the CTrade class of the Expert Advisor works incorrectly on the server you are using. If it is still bad... You can also write to Service Desk and say that you can't run the robot, there is an error... But first of all, be sure to try to run it on demo methaqvot server!
 

Help Plz!

1 Here is the function:

 if (OrdersTotal()==1) 
   if(profit>=tp_in_money || a>0) 
   {
      closeall();
      closeall();
      closeall();
      //a++;
      //if(total()==0) a=0;

This means to close all orders when a certain profit is reached.

And I want them to close at a certain profit-defined MAJIKa not tell me how to do it? maybe add afterOrdersTotal()cheta need????e.g.!=magic ?????????

Please give me a hint, I'm just trying to figure it out.

2) To put a virtual stop of 50% of the deposit, am I right?

double BOL    =AccountBalance();
double PROS    =AccountCredit();
   if(PROS<BOL*0.5 || a>0) 
   {
      closeall();
      closeall();
      closeall();
      //a++;
      //if(total()==0) a=0;
 
CapitalUser:
Help Plz!
1 here is a function:
if(OrdersTotal()==1)
if(profit>=tp_in_money || a>0)
{
closeall();
closeall();
closeall();
//a++;
//if(total()==0) a=0;
What I mean here is that all orders must be closed once a certain profit is earned.
And I want them to close at a certain profit-defined MAGIC can you tell me how to do this? maybe add after OrdersTotal()cheta need????e.g.=magic ?????????
Please tell me, I can't understand it.

2) I want a virtual stop of 50% of the deposit, I am right:

double BOL =AccountBalance();
double PROS =AccountCredit();
if(PROS<BOL*0.5 || a>0)
{
closeall();
closeall();
closeall();
//a++;
//if(total()==0) a=0;

  • Painfully familiar design, but okay.

I don't claim to be perfect.

//+------------------------------------------------------------------+
void CloseProfit(int mag,double profit)
  {

   double pro=0,pri=0;
   static bool flag=false;
   for(int i=OrdersTotal()-1; i>=0; i--)
      if(OrderSelect(i,SELECT_BY_POS))
         if(OrderSymbol()==_Symbol)
            if(OrderMagicNumber()==mag || mag==-1)
               pro+=OrderProfit()+OrderCommission()+OrderSwap();

   if(pro>=profit)flag=true;  if(pro==0)flag=false;

   for(int i=OrdersTotal()-1; i>=0; i--)
      if(OrderSelect(i,SELECT_BY_POS))
         if(OrderSymbol()==_Symbol)
            if(OrderMagicNumber()==mag || mag==-1)
              {
               if(OrderType()==OP_BUY )pri=Bid;
               if(OrderType()==OP_SELL)pri=Ask;
               if(OrderClose(OrderTicket(),OrderLots(),NormalizeDouble(pri,_Digits),30,clrRed)==false)
                  Comment("Error "+GetLastError());
              }

  }
//+------------------------------------------------------------------+
 
VOLDEMAR:

  • Painfully familiar design, but okay.

I don't claim to be perfect.

Thank you!
 
Tapochun:
Have you tried to open a demo account on MetaQuotes-Demo server? If no - try it, if everything is OK - write to Service Desk and complain that the CTrade class in your EA does not work properly on the server. If it is still bad... You can also write to Service Desk and say that you can't run the robot, there is an error... But first of all, be sure to try to run it on demo methaqvot server!

Thank you very much!

It worked inMetaQuotes-Demo. I will write to the service desk in the week to get the BCS5-Real server sorted out.

 
Maxi-M:

Thank you very much!

It worked inMetaQuotes-Demo. I will write to the service desk in the week to get the BCS5-Real server sorted out.

You're welcome. Unfortunately, EAs may work differently on different servers.
 

Good evening, gentlemen!

Question: Is it possible to create graphical elements(trend line, indicator..........) with Gif extension, i.e. with animation effect (shimmering, flashing..........) in MT4? Thank you for your reply.

 
gnawingmarket:

Good evening, gentlemen!

Question: Is it possible to create graphical elements(trend line, indicator..........) with Gif extension, i.e. with animation effect (shimmering, flashing..........) in MT4? Thank you for your reply.

Your question is not clear, software can do lines and stuff, but what do you mean by gif?
 
VOLDEMAR:
Your question is not clear, software can do lines and stuff, but what do you mean by gif?
Generally speaking, yes, the question is raw. I'll take time out...... let the topic simmer in my cauldron. Thank you.
Reason: