What does this mean?
"ultimul_lot gets the value 1.#INF but I do not understand why..."
Is the lot value 1?
If it is then there should not be a problem.
What does this mean?
"ultimul_lot gets the value 1.#INF but I do not understand why..."
Is the lot value 1?
If it is then there should not be a problem.
first of all, thx for reply!
1.#INF means infinite (such as x/0) and that is not ok...
extern double multiply_lots=3; int init() { ultimul_lot=0.1; //...} void OrderOp(string sugestie){//... ultimul_lot = OpenOrder(sugestie); } double OpenOrder(string sugestie){ double loturi_x=ultimul_lot; if (ultimul_profit<0){loturi_x=ultimul_lot*multiply_lots;}else{loturi_x=loturi;} //... return(loturi_x); }
On the first call to OpenOrder ultimul_lot=0.1 and after OrderOp sets it to 0.1*3 or 0.3.
On the second call it becomes 0.9. Third 2.7, etc becomes infinite quickly.
On the first call to OpenOrder ultimul_lot=0.1 and after OrderOp sets it to 0.1*3 or 0.3.
On the second call it becomes 0.9. Third 2.7, etc becomes infinite quickly.
you are corect...thx
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
I am working on a simple EA but I get the error 131 and this is because of the variable
in the function OpenOrder where I make:
ultimul_lot*multiply_lots;
ultimul_lot gets the value 1.#INF but I do not understand why...
The ideea is that if the last trade was not profitable it will double the last trade's lots; if the last trade was profitable the next trade will have the initial no. of lots ("loturi").
Could someone help me on this isue?