hi im having issue i wrote a function isthereactiveorder() if there is a buy dont open a buy if there is sell dont open sell it seems to not working, if any one can provide any guides i well be thankful
Hello,
need to call first the isthereactiveorder() function and then the cheackmacross(). First check if there are opened orders and then check signals to open new orders.
Next, need to reset canbuy=false and cansell=false on top of OnTick() function.
I have made some change in your code.Hello,
need to call first the isthereactiveorder() function and then the cheackmacross(). First check if there are opened orders and then check signals to open new orders.
Next, need to reset canbuy=false and cansell=false on top of OnTick() function.
Thanks for your reply , i did what you suggest you can check the code again ,nothing changed yet still ton of orders
Thanks for your reply , i did what you suggest you can check the code again ,nothing changed yet still ton of orders
Corrected code...
Corrected code...
great thanks , if you may explain how my logic is wrong i will be thankful
great thanks , if you may explain how my logic is wrong i will be thankful
You set in 2 function 'canbuy' parameter and 'cansell'. isthereactiveorder and cheackmacross are the two functions.
But the correct way is to count buy and sell orders on 'isthereactiveorder ' function. I deleted 'canbuy/cansell' parameters from 'isthereactiveorder ' function, and I set it to calculate orders with new parameters 'CntBuy/CntSell'.
Now, if canbuy = true and CntBuy = 0, then expert open buy orders, same for the sell orders....
- www.mql5.com
You set in 2 function 'canbuy' parameter and 'cansell'. isthereactiveorder and cheackmacross are the two functions.
But the correct way is to count buy and sell orders on 'isthereactiveorder ' function. I deleted 'canbuy/cansell' parameters from 'isthereactiveorder ' function, and I set it to calculate orders with new parameters 'CntBuy/CntSell'.
ok i thought since cansell/canbuy is global variable so any function can access it and change it
ok i thought since cansell/canbuy is global variable so any function can access it and change it
Yes, but isthereactiveorder function cansell/canbuy if there are opened orders turn false, but the cheackmacross function turn they true... cheackmacross function canceled isthereactiveorder function.
If you want to check 2 differents facts (orders and signals) is better to use 2 differents parameters.
- www.mql5.com
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
hi im having issue i wrote a function isthereactiveorder() if there is a buy dont open a buy if there is sell dont open sell it seems to not working, if any one can provide any guides i well be thankful