[Archive!] Any rookie question, so as not to clutter up the forum. Professionals, don't pass it by. Couldn't go anywhere without you - 2. - page 355

 

Please enlighten me:

If in the course of a series made by Dynamic, for example, I wanted to increase the base Pipstep overnight (or change the LE, or TP), how much will this break the EA's logic?

Thank you!

 
Zhunko:
You have to loop it.
It is better to abandon the start function then. And outside of it, organize its own interrupt function, with required intervals in sec, min, by setting interrupt flags. And main body of program, just cycle through these flags, and when they are ready, execute custom procedures. And one of these procedures can be used for obtaining a fresh quote, it won't be tick-based, but we can set the right load factor in seconds and get it as needed. Thus, it will be a real time system, not connected with events - tick. That's the way it is.
 
What function gets the spread on the current pair?
 
_Aybulat_:
What function gets the spread on the current pair?

1 Ask-Bid

2 MarketInfo

 
_Aybulat_:
Which function gets the spread on the current pair?


https://docs.mql4.com/ru/common/MarketInfo

int spread=MarketInfo("EURUSD",MODE_SPREAD);

 
Yes, I did.
 

Hello all. I came across an interesting point while trading.

I have a trading account monitoring function in some brokerage company (X). I try to use it but sometimes I´ve got strange strange moments (see image below).

At the gap does not look like because gepa notбыл, and left somewhere and then return back, as if the withdrawal and deposit. Who has been dealing with this?

I did not ask DC because I do not want to draw attention to myself unnecessarily

 

I can't see it.

Here's a piece of code.

paste the code correctly

if(OrderSelect(0, SELECT_BY_POS)==true)
{
order_type = OrderType();
//---- Тралл длинных позиций ------
if(order_type == OP_BUY)
{
if(OrderStopLoss() == SARCurrent_S - 3)
return(0);
if(SARCurrent_S <= iLow(Symbol(),15,0))
{
stop = SARCurrent_S - 3; //Уровень стоп-лосс Парабола - 3 пункта
OrderModify(OrderTicket(), OrderOpenPrice(), stop, 0, 0, Aqua);
return(0);
}
}
//---------------------------------
//---- Тралл коротких позиций -----
if(order_type == OP_SELL)
{
if(OrderStopLoss() == SARCurrent_S + 3 + MarketInfo(Symbol(),MODE_SPREAD))
return(0);
if(SARCurrent_S >= iHigh(Symbol(),15,0))
{
stop = SARCurrent_S + 3 + MarketInfo(Symbol(),MODE_SPREAD); //Уровень стоп-лосс Парабола + 3 пункта + спред
OrderModify(OrderTicket(), OrderOpenPrice(), stop, 0, 0, Aqua);
return(0);
}
}
//---------------------------------
}

OrderModify error 1

At the same time, according to the log, the order is modified correctly but the stop does not trigger when the price reaches it.

By the way, how do I paste the code correctly here on the forum?

 
_Aybulat_:

I can't see it.

Here is a piece of code.

Выдаёт ошибку OrderModify error 1


there is simply no need to modify the order - all parameters of the existing order coincide with the new ones

ignore it - look at the error description - error #1 - "no error"

https://docs.mql4.com/ru/constants/errors

 
_Aybulat_:

By the way, how to properly highlight code here in the forum?


SRC button