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
If your Expert Advisor is multi-currency, you have to.
The more so because the Bid and Point values areprobably already set (stated) through MarketInfo().
Once I started a branch on multicurrency Expert Advisor. Have a look and some questions will be clarified....
'Multicurrency Expert Advisor Question'.
And here specifically on the modification
'Multicurrency advisor question'
I made this variant... Immediately after opening, I call ModifyPos()
Stop - 20.
TakeProfit - 100
Message in the log - OrderModify error 130
Try a buy position for the take positions
Think about it! Why is it that for a buy position take profit is suddenly below the current price?
No wonder that an error is generated
And the same for the sell position...
If you don't need to change Take Profit, then it's better to do this:
Similarly, for the sell-sideThink about it! Why is it that your take profit on a buy position is suddenly below the current price?
No wonder that an error is being generated!
Rid thanks a lot!
I wasn't paying attention)... it worked and even worked)
The last error that is now in the log during testing is OrderSend error 138.
This error occurs without interruption when there are no trades, i.e. for every tick this error occurs.
As soon as an order is triggered, the error disappears... the order closes and the error goes again...
It looks like it is trying to send an order without any signals... But I don't understand why, since there is an(if) condition to sell and to buy
The last error that is now in the log during testing is OrderSend error 138.
This error occurs without interruption when there are no trades, i.e. for every tick this error occurs.
As soon as an order is triggered, the error disappears... the order closes and the error goes again...
It looks like it is trying to send an order without any signals... But I don't understand why, since we have conditions(if) to sell and to buy.
do not read carefully read https://book.mql4.com/ru/content it is all there
Reading and understanding are different things... I want to understand in practice)
There is a condition for entering, after these conditions are met the control is passed to the function that opens the order...
I cannot understand how OrderSend is trying to work bypassing conditions... and logically it generates an error... because there are no entry conditions
Refreshes data in predefined variables and time-series arrays. This function is used when an Expert Advisor or script has been performing calculations for a long time and needs updated data. It returns TRUE if the data is updated, otherwise FALSE. The data may not be updated only because it corresponds to the current state of the client terminal. Expert Advisors and scripts work with their own copy of historical data. The copy of data on the current symbol is created at the initial launch of the Expert Advisor or script. At every next launch of the Expert Advisor (remember, the script is executed once and does not depend on incoming ticks), the initially created copy is updated. During the time the Expert Advisor or script runs, one or more new ticks may come, so the data may become outdated.
//------------------------------------------------------------------------------
Try to insert this function before executing OrderSend
See also: Opening and Setting Orders 2008-05. :Opening and Setting Orders 2008-05-05 14:26:13
"For the program to work steadily, with a minimum number of rejected trade orders, before executing the OrderSend() function, the information environment parameters used by the program should be updated using MarketInfo() and RefreshRates() functions."
doesn't help...