Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 538
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
This method of swap calculation is called rollover. You cannot know about it programmatically in MT4. Only indirectly after the midnight change of working market orders. There are a lot of such small, but rather unpleasant problems in MT4. In MT5 there are a little less, but they still exist.
These are the swap values in pips. They should be converted into the currency of the deposit, based on the volume of the market order. Then you will get the real swap size.
"There is no way to find out about it programmatically in MT4". - Thank you for your time and replies.
Good day! Dear forum users, please help me to understand the algorithm. The aim is to determine the price range in the specified period of time and set the buy and sell stops at max and min. Stoplosses are set on opposite orders, TakeProfit should be equal to StopLoss*2.
Then, after each closing by Stop Loss, the order is restored with the same Stop Loss and Take Profit as the closed one and the whole cycle is completed once one of the orders is closed by Take Profit. And all from the beginning we define the range and go.
But now he just does not place TP or rather he places it at the open price and stop loss is not on the range size, i.e. not on an oppositely directed order. I thank him in advance for his help.
There is no need to duplicate questions in different threads.
Good afternoon!
When testing in the log I get OrderSend error 130 - if I understand correctly it can only be related to stops or strokes, please check what is wrong:
Good afternoon!
When testing in the log there is an error OrderSend error 130 - if I understand correctly it can only be related to stops or strokes,
The open prices of pending orders are also affected. That is why we need to check the distance between the current market price and the open price of the order. In this case: Price - Ask.
The opening price of pending orders also applies. Therefore we should also check the distance between the current market price and the opening price of the order. In this case: Price - Ask.
What does the Hour() function return ?
Returns the current hour. that's how I work: if the current hour is greater than 11 and less than 17,
but how?
It's a bit complicated for me. Could you explain in which part of the code to add and what does it mean mn and mag_n? where should I put my EA medjic here?
Before your condition put
mag_n - where do I put my EA's IG here?
I am writing: if the current hour is more than 11 and less than 17, how should it be?
I understand that the question is about the indicator. Instead ofHour() -> time[i]
I understand the question is about the indicator. Instead ofHour() -> time[i].
Yes, you helped that, now I want to limit the time. Exclude counting from 5pm to 11pm.