Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 1334

 
Alexey Viktorov:

There is always a null trade, the first with time type IN and the last with time type OUT and they all have the same POSITION_IDENTIFIER. But if there were several closures in parts, then this has to be checked carefully. I haven't tried it, but everything can be solved, and I have no doubts about it. Any profit in pips is always calculated depending on the volume, therefore it must be calculated by opening and closing volumes.

I'm against the universality of functions, so I don't invent all that crap that bullshit SMS messages may send to the brain.

Alexey, without any hindsight, I want to know your opinion:

"profit in pips is based on volume" .... I don't really understand this statement.

My understanding is that profit in PUNDS is profit in pips. It has nothing to do with volume or currency.

At the same time, I understand that ... many people perceive a profit in a certain currency.

From these MY misunderstandings, the question is: wouldn't it be easier for MQ to make a digestible conversion of points to currency?

That would save ALL - from writing conversion functions and from questions to MQ of this kind.

I'd be happy if you could explain where I'm wrong. )))

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

Alexey, without any hindsight, I would like your opinion:

"profit in pips counts according to volume" .... I don't really understand this statement.

My understanding is that profit in PUNDS is profit in pips. It has nothing to do with volume or currency.

At the same time, I understand that ... many people perceive a profit in a certain currency.

From these MY misunderstandings, the question is: wouldn't it be easier for MQ to make a digestible conversion of points to currency?

That would save ALL - from writing conversion functions and from questions to MQ of this kind.

I'd be happy if you could explain where I'm wrong. )))

My experience of profit in pips comes only from what I have read. I've never done it myself, probably for the same reason of misunderstanding. Well, they wrote that 1 point of lot 0.01 and 1 point of lot 1 cannot be compared. I've never done it myself, probably for the same reason as I never understood. I do not know what was the purpose of it.
 
Hi all! Is it possible to turn off the grid in the betting-ballpot in MT5?
 

I want to sell when the price touches the upperBollinger Band and close on the middle band and buy when the price touches the lower band and close on the middle band. For this I have prescribed:

double LB, UB, ma;

double Price= iClose(NULL, 0, 0);


LB = iBands(NULL, PERIOD_M15, Bands_period, Bands_deviation, 0, PRICE_CLOSE, MODE_LOWER, 0);

UB = iBands(NULL, PERIOD_M15, Bands_period, Bands_deviation, 0, PRICE_CLOSE, MODE_UPPER, 0);

ma = iMA(NULL, PERIOD_M15, 20, 0, 0, PRICE_CLOSE, 0);

if(OrderType()==OP_BUY)

{

if(Price>= ma)

{

Ticket=OrderClose(OrderTicket(),OrderLots(),Bid,50,Violet);

return(0);

}

if(total==0)

{

if(Price <= LB)

{

Ticket=OrderSend(Symbol(), OP_BUY,Lots,Ask,50,0, "Long position",16384,0,Red);

return(0);

}

Why doesn't it open and close in places where there are yellow arrows in the picture when testing?

 
Nataliia Darsavelidze:
Hi! In the chart settings there is an option to "show trading history". How is it implemented in the code? I cannot remove it programmatically. Thank you.

Perhaps someone could use it:

//+------------------------------------------------------------------+
void DEL_OBJ_AUTOTRADE()
  {
   int seek_obj=ObjectsTotal(0,-1,-1);
   for(int posobj=seek_obj; posobj>=0; posobj--)
     {
      if(StringSubstr(ObjectName(0,posobj,-1,-1),0,9)=="autotrade")
        {
         if(ObjectDelete(0,ObjectName(0,posobj,-1,-1))) {;}
        }
     }
  }
//+------------------------------------------------------------------+
 
Nataliia Darsavelidze:

Perhaps someone could use it:

ObjectsDeleteAll(0,"autotrade");
 
Vitaly Muzichenko:

There are very long names in there. It's removal by name part

 
Nataliia Darsavelidze:

There are very long names in there. It's removal by part of the name

you create objects with a prefix and then use that to delete them.

void OnDeinit(const int reason)
  {
   ObjectsDeleteAll(0,prefix,0);
name=prefix+"Deal:"+string(ticket);     //трассер
            name2=prefix+"Price:"+string(ticket);   //цена сверху
            if(entry==DEAL_ENTRY_IN)
              {
               ObjectCreate(0,name,OBJ_ARROW_LEFT_PRICE,0,time,price,0,0);
 
Fast235:

You create objects with a prefix and then delete them.

These are automatically created. Trade history.

 
Nataliia Darsavelidze:

There are very long names in there. It's a deletion in the name part.

Did you check?