If you are having insurmountable problems with the validation of an EA, then you definitely need this function.
I authorize its use in commercial EA. I give the source code to those who pay for unlimited use. You will be able to insert the function into your code, which will allow you to avoid importing library files (it prohibited by the Market conditions).
The function performs all the order checks required by the Market (minimum and maximum deal-volume, volume step, sufficient free
This little script will brighten your life.
Below is its code, you can insert it into OnInit of any robot.
Or change the colors and scale to suit your taste #property copyright "V.Temchenko Skype:vasily.temchenko" #property link "Mailto:email@example.com" #property version "1.00" #property strict #property description "Have questions? Skype: vasily.temchenko Viber: +38098 800-6-800" ; #property description "If the voice - only Russian, Ukrainian or Belarusian" ; #property
Function of the correct decrease in the volume of the deals
Everybody checks the availability of a sufficient amount of margin - this is a mandatory requirement of the Market.
But the trader does not benefit from this.
The deal will not open if at least 1 cent of the margin is not enough. It doesn't matter who refuses, terminal or robot.
This is dangerous. If the trader is not able to constantly be near the computer, then any such refusal can lead to the loss of the deposit.