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

 
ToNy_Nazarov:
Question completely solved, thanks for the help!

//--------------------------------------------------------------------
int start()
{
double delta = Ask-Bid;
double delta2 = 1.10059-_Point;
Comment("Bid = ", DoubleToString(Bid,5),
"\nAsk = ", DoubleToString(Ask,5),
"\nDelta = ", DoubleToString(delta,5),
"\nDelta2 = ", DoubleToString(delta2,5),
"\nPoint = ", DoubleToString(_Point,5),
"\nDigits = ", Digits);
return(0);
}
//--------------------------------------------------------------------



Get the digits first and then use it. In this case instead of 5

there must not be "magic constants" in good code

Ask-Bid = Spread (+-=) 1 * _Point; // +-= depending on the purpose of the calculation. Because strictly by mathematics it is 1/2 _Point, which is beyond the limit of applicability

 

Suddenly the MT4 demo account I used to work on the EA was blocked.

Probably because it had existed for a long time.

I could not open a new demo account. The process hangs when I specify the login and password.

The attempt to download and install new distribution of MT4 led to some unexpected results.

I installed MT5, with all its attributes and a new demo account.

The only problem is that all my programs are written in MQL4.

What is the problem with MT4, how do I install it and get a demo account ?

 
Zlaya_budka:
in experience, support may not respond at all. but to add to their account to play on the exchange and account to pay for purchases in mccommunity in rubles at the bank rate all by itself will be solved or what? etc. I have already bumped into the fact that the security tab is not at all on the profile tab but on the next, and the same with wrong settings of antiviruses (to block external connection attempts by default in all instances of incomprehension with the certificate).

experience. kaspersky does not let on this site. nod32 lets in here and on the site of the intermediary but does not let on "account refill" (on that page) though has its own bank browser, support of the intermediary advises to disable antivirus (aha right ...) then come to the elite office to pay and hurray he disabled for fraud on the spot by an employee in the office. well hurray that =)

 
Zlaya_budka:

I had an experience. kaspersky does not allow access to this site. nod32 allows here and on the site of the intermediary but does not allow on "account refill" (to that page) although has its own bank browser, support of the intermediary advises to disable antivirus (yep right ...) then I come to the office for a live payment and hurray it is disabled for fraud on the spot by an employee in the office. well hurray for=)

When I paid via PayPal to the programmer, I saw that the dollar exchange rate ismore than a hundred rubles per quid. i put a screencap on my profile in the feedhttps://c.mql5.com/1/166/nar.jpg

0.01524 to be exact dollars per ruble. When I switched to mcl5, the exchange rate magically changed to RUR 77 cents and incomplete RUR 40 cents. When you switch to palka from mcl5 the exchange rate magically changes from 77 ue to an incomplete 40 ue.

AYNIDHELP.......
 
Zlaya_budka:
When I paid via PayPal to the programmer, I saw that the dollar exchange rate is more than a hundred rubles per quid. i put a screencap on my profile in the feed https://c.mql5.com/1/166/nar.jpg

0.01524 dollars per ruble to be precise. On palka whist in rubles and there ruble see the commission as an average of 65 per dollar. in the forum so far did NOT see a branch on payments. When you switch to palka from mcl5 the exchange rate magically changes from 77 ue to an incomplete 40 ue.

AYNIDHELP.......

1$ : x (roubles) = 0.01524 $ : 1 rouble ---> x = 1$ / 0.01524 = 65.61679790026247 roubles

Central Bank of the Russian Federation - Exchange Rates - US Dollar (USD)

Date Exchange rate Change

from 20.11.2019 63.7730 +0.0188

From 19.11.2019 63.7542 -0.1339

from 16.11.2019 63.8881 -0.322

from 15.11.2019 64.2101 +0.0092


are you still in school?


I don't use it now, but it seems that stick used to have a provision for debited funds to be higher than the quoted rate for a few days and then to be restored when the final debit is made.

 
Igor Makanu:

1$ : x (roubles) = 0.01524 $ : 1 rouble ---> x = 1$ / 0.01524 = 65.61679790026247 roubles

are you still in school?


I do not use it now, but it seems that once at a "palka" that the amount of funds written off can be reserved more than the specified rate for a few days, then the final write-off everything should be restored, in general, the rules of payment to read "palka"

unfortunately you are wrong (while writing started to suspect that they may be right in part). if you count the rate all is normal, then you are right, but if you look at the screenshot, it looks at me (just imagine that you get an SMS from the bank when the credit card from his wife) that after withdrawal of 30 cu of 77 at the rate of 65 remain incomplete 30. why? the screenshot shows the remainder in rubles 1900 ree is 30 cu. so out of 5000 ree after withdrawing 30 cu will remain 30 cu. let's assume that now I have a 1910 re not the remainder but a debited amount and then it would be ok. but excuse me,I know that the balance on the stick account I have 5000 rubles and withdraw 30*65 1950 so the TOTAL should be 3000 and not 200. right? i.e. there are two reasons why i should press OK and not 1968 but 3032.


well, getting back to the "sms from the bank while the wife's card "as you will understand if you got a new salary card in the new bank it took my wife and then you see - sms balance 200 rubles, it's she that, she wrote off at 39800 and the balance of 200 or, it's the balance of 200 and wrote off 39800? let's say in fact wrote off 200 and this is such an unfortunate transfer is not funds and words. but this is not ethical.



ZSY-reading the answer below I have corrected, I used my wits and courage and found out by experience that the cheque is 65 and not 130, and the word balance is a difficult Russian in the translator Palka. At the same time, I have faced with the fact that the TOR are 64,000 characters long, and I had to rewrite it in notepad, that I can not copy a long TOR, but I have to write it, that drawings fit in, but then disappear and their only kosher in the text, and the address must be removed in the applications. And so I wrote the TOR and the text twice, for I was told to write clearly (!), so I wrote it as it should be and then as I see it as a user the same, of course the text came out similar. Hello Freelance moderation.

 

Um, here's a question. Please help me.

MQL4strategy tester.

I prescribed in my Expert Advisor to start trading only after 6 am server time and close all positions after 11:20 pm. The Tester ignores both of these times. :( I think it should emulate the time. So, everything should work correctly. Maybe I have made a mistake somewhere?

void OnTick()
  {
//-------------------------------------------------  
  // Мини скрипт на открытие сетки после 6 часов и закрытие ордеров после 23 часов
  if(Hour() < 6 && Minute() >= 0)
  {
  return;
  }
  if(Hour() == 23 && Minute() > 20)
  {
  for(z=OrdersTotal()-1; z>=0; z--)    // закрытие всех ордеров.
        {
         if(OrderSelect(z,SELECT_BY_POS)==true && OrderSymbol() == Symbol())
           {
            OrderClose(OrderTicket(),OrderLots(),OrderClosePrice(),3,Red);
              if ( OrderCloseTime() == 0 )
                {
                OrderClose(OrderTicket(),OrderLots(),OrderClosePrice(),3,clrRed);
                }
           }
        }
        for(z=OrdersTotal()-1; z>=0; z--)    // закрытие всех ордеров.
        {
         if(OrderSelect(z,SELECT_BY_POS)==true && OrderSymbol() == Symbol())
           {
            OrderDelete(OrderTicket(),Red);
              if ( OrderCloseTime() == 0 )
                {
                OrderClose(OrderTicket(),OrderLots(),OrderClosePrice(),3,clrRed);
                }
           }
        }        
  }
.................
сам советник
.................

}
 
Zlaya_budka:

Unfortunately you're wrong.

I don't use palka for 5 years.

the seller invoiced you in $, you could choose the conversion at the stick rate or at the rate of your bank - this was in the second step of payment

In other words, if you have seen in the first step of the payment the amount billed by the seller in $, then all questions to either the palka or to the bank


Gilmor:

So everything should work correctly. Maybe you made a mistake somewhere?

if(Hour() < 6 && Minute() >= 0) return;

if(Hour() == 23 && Minute() > 20)

simply check the conditions by substituting time in hours and minutes, for short, from 23.21 to 23.59 will work these conditions, and the condition Minute () >= 0 does not make sense, the minutes are always 00-59

search for it, I posted a time trade, there were examples in QB

 

просто проверьте условия путем подстановки времени в часах и минутах, если кратко, то с 23.21 до 23.59 будут работать эти условия, причем условие  Minute() >= 0 не имеет смысла, минуты всегда 00-59

search for it, I posted a time trade, there were examples in QB.

Thank you. I'll look it up as well.

 
Dear programmers! Could you please decode the mq4 code?
I sincerely hope you will respond to this request. Thank you!
Reason: