Pending Order EA
Hello Everyone, Please I am trying to create a bot that takes a buy stop and sell stop order simultaneously at a a particular time but it seems there's a trade order error. Code attach below
Files:
StraddleNews_2nd_Strag_GPT_Dec23.mq4
15 kb
- Open pending orders!
- HI everyone EA coding issue please help!
- How to create a pending order
badim004: Hello Everyone, Please I am trying to create a bot that takes a buy stop and sell stop order simultaneously at a a particular time but it seems there's a trade order error. Code attach below
Why does your EA name include the word "GPT"?
There is no GPT functionality in thes code, so I can only assume that it is because it was generated by by ChatGPT (or some other A.I.).
Is that the case?
There is no trade error. There is only your error; your code does not have any trading logic.
void OnTick() { // Your trading logic here... // Example: If a loss occurs if (/* Condition for a loss */) { OnLoss(); } // Check if there should be a delay if (ShouldDelayTrading()) { Print("Delaying trading for 6 hours after 2 consecutive losses."); return; // Do not take any trades during the delay } // Continue with your trading logic... }