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

 
Leo59:
Artyom, please, a WORKING example of code is needed!!!!

And what you gave.... For example line 87 : maHandle=iMA(Symbol(),0,ExtPeriod,0,MODE_EMA,PRICE_CLOSE);
Well, where does it fit in?

This should climb into the gates of your mind. Code for Five. Please search the site yourself - I searched and posted the first thing I came across indiscriminately. Or just look at the code, and understand what for.

It's about helping those who want to understand, not about fulfilling whims.

 
Question for professionals. The Expert Advisor opens an order with zero TP and SL parameters and then modifies it by setting appropriate parameters. Everything has been working perfectly for a long time on several accounts. However, I have recently opened an NDD account with Forex4you and have noticed that sometimes the modification does not happen immediately (when there is only one order on a pair), but only when I run the terminal again. There are no entries in the logs (apart from opening and modification at next start) about attempts of modification (there are 7 attempts in my Expert Advisor). What can it be related to (it does not modify immediately) - with peculiarities of NDD accounts, floating spread, incorrect operation of the terminal with this type of accounts, or something needs to be corrected in the EA code for such accounts.
 
Youri Lazurenko:   An EA opens an order with zero TP and SL parameters and then modifies it.

Try before modifying while( ! RefreshRates() ); with a semicolon at the end

or Sleep(1000); Delay 1 second or while( ! RefreshRates() ) Sleep(1000); Sometimes it helps to call the broker.

 
STARIJ:

Try before modifying while( ! RefreshRates() ); with a semicolon at the end

or Sleep(1000); Delay 1 second or while(!RefreshRates()) Sleep(1000); Sometimes it helps to call the broker...


Thank you, I will try. Calling the broker didn't help (that's how I started).

Made a change, will see the result tomorrow. I still think something is wrong with execution and not with EA - the same EA, on the same account, only on another pair opened and modified the order as it should be.

 
Guys, hi. Can you tell me how to convert the commission into points? The spread can be converted via MODE_SPREAD .
 
Rustam Bikbulatov:
Guys, hi. Can you tell me how to convert the commission into points? The spread can be converted using MODE_SPREAD .

What for?
 
Vitalie Postolache:

What for?

what for, to transfer the commission to points?

tv=SymbolInfoDouble(Symbol(),SYMBOL_TRADE_TICK_VALUE);

(OrderCommission()/(tv*OrderLots()))*Point()
 
Vitaly Muzichenko:
What's the point of transferring the commission to points?

Yeah
 
Vitalie Postolache:

Yeah
You might want to add points to a stop loss order, for example, or to a trawl.
 
Vitaly Muzichenko:
If not, for example, if you want to add points to a stop loss order or to a trawl.

The commission has nothing to do with the price points. It is charged from an order regardless of the number of points that the price passed during the lifetime of this order. Yes, you can translate it to points, but it will be a bit larger than the spread. So, I asked, what is the use of it? Perhaps the Pipsatters with the targets smaller than the spread?
Reason: