Why this scrip does not work,.
when there is no error
anyone can help
You have two issues here, suggest you revisit your Lots function and the ordersend function:
1. Invalid Lots amount for ordersend function
2. Order Send Error 148 (The amount of open and pending orders has reached the limit set by the broker. New open positions and pending orders can be placed only after the existing positions or orders have been closed or deleted.)
Mod edit: Advertising removed
Look here: https://www.mql5.com/en/users/register
It says . . . "4. Posting of advertising messages is forbidden. "
Do not attempt to Advertise, next time you will receive a Ban.
Review:
1. The script creates to many orders because the loop to create the order repeats itself non-stop. Perhaps place a limit so that it does not re-run the order send function:
2. The order operation type is incorrect. I modified the operation type to OP_BUYLIMIT for it to start opening orders.
3. There also seems an issue with calculating the next lot size. Try changing all to correct operation type of buy limit, including comments.
bool enter = true; ---------------------------------- if (enter == true) { for(x=0;x<=MaxTrades;x++) { if(x<=1) { OrderSend(Symbol(),OP_BUYLIMIT,LotSize,NormalizeDouble(start_BUY_STOPx,Digits),3,slbx,tpbx,CommentTrades,MagicNumber,expiration); } if(x>1) { BUY_STOPx=FindLastOrder("buystop","Price")+jarak_antar_Po *Point; OrderSend(Symbol(),OP_BUYLIMIT,NextLot("buystop"),NormalizeDouble(BUY_STOPx,Digits),3,slbx,tpbx,CommentTrades,MagicNumber,expiration); } if (x==MaxTrades) { break; } } enter = false; } } return(0);
Thank you
DTK_Forex
Play video | Please edit your post. For large amounts of code, attach it. |
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Why this scrip does not work,.
when there is no error
anyone can help
,.