Order Send not inserting new order

 

I am using Octa-FX Meta Editor to generate my Expert Advisor but simple OrderSend is not sending new sending my new order plz check the code below.



//+------------------------------------------------------------------+
//|                                               HorizontalLine.mq4 |
//|                        Copyright 2020, MetaQuotes Software Corp. |
//|                                             https://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2020, MetaQuotes Software Corp."
#property link      "https://www.mql5.com"
#property version   "1.00"
#property strict
extern double Value=0;
extern double pipsToBear=300;
//+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+
int OnInit()
  {
//---

//---
   return(INIT_SUCCEEDED);
  }
//+------------------------------------------------------------------+
//| Expert deinitialization function                                 |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
  {
//---
  }
//+------------------------------------------------------------------+
//| Expert tick function                                             |
//+------------------------------------------------------------------+
void OnTick()
  {
//---
   Alert(Ask);
   OrderSend(Symbol(),OP_BUY,0.01,Ask,3,0,0,"Buy2",0,0,clrGreen);
  }
//+------------------------------------------------------------------+
//| Tester function                                                  |
//+------------------------------------------------------------------+
double OnTester()
  {
//---
   double ret=0.0;
//---

//---
   return(ret);
  }
//+------------------------------------------------------------------+


Discover new MetaTrader 5 opportunities with MQL5 community and services
Discover new MetaTrader 5 opportunities with MQL5 community and services
  • www.mql5.com
VR Watch list and Linker MT5 VR Watch list and Linker is an expert advisor for synchronous changes of financial instruments in open windows of the MetaTrader terminal. Choosing a trading instrument in the market overview, you will immediately get charts in the open terminal windows. Each window can be configured individually by you. ⚡With the...
 
shezi628 :

I am using Octa-FX Meta Editor to generate my Expert Advisor but simple OrderSend is not sending new sending my new order plz check the code below.

Please use the button to insert the code Code(the first time I corrected your post and put the code correctly).

You are on the MQL5 forum. For questions about the old terminal, there is only one special section: MQL4 and MetaTrader 4 - please ask all questions about the old terminal only in that section (for the first time I will transfer your topic).

 
shezi628:

I am using Octa-FX Meta Editor to generate my Expert Advisor but simple OrderSend is not sending new sending my new order plz check the code below.




What is it say in journal/experts tab?

 
shezi628:

I am using Octa-FX Meta Editor to generate my Expert Advisor but simple OrderSend is not sending new sending my new order plz check the code below.




Check the return of OrderSend and debug it...

int ticket=OrderSend(Symbol(),OP_BUY,0.01,Ask,3,0,0,"Buy2",0,0,clrGreen);
   if(ticket<0) 
     { 
      Print("OrderSend failed with error #",GetLastError()); 
     } 
   else 
      Print("OrderSend placed successfully"); 
 
shezi628: I am using Octa-FX Meta Editor to generate my Expert Advisor but …
EA builder, EA Builder Pro, EATree, Etasoft forex generator, Forex Strategy Builder, FOREXEADVISOR STRATEGY BUILDER, FX EA Builder, fxDreema, FxPro, Molanis, Octa-FX Meta Editor, Online Forex Expert Advisor Generator, Strategy Builder FX, Strategy Quant, Visual Trader Studio, MQL5 Wizard, etc., are all the same. You will get something quick, but then you will spend a much longer time trying to get it right, than if you learned the language up front, and then just wrote it.
  1. Since you haven't learned MQL4/5, therefor there is no common language for us to communicate.
    If we tell you what you need, you can't code it.
    If we give you the code, you don't know how to integrate it into yours.
    We are willing to HELP you when you post your attempt (using SRC) and state the nature of your problem, but we are not going to debug your hundreds of lines of code. You are essentially going to be on your own.

  2. EA builder makes bad code counting up while closing multiple orders.
    EA builder makes bad code Bars is unreliable (Max bars in chart), volume is unreliable (miss ticks.) Always use time.
    EA builder makes bad code, not adjusting for 4/5 digit brokers, TP/SL and slippage.
    EA builder makes bad code, not adjusting for ECN brokers. pre-Build 500)
    EA builder makes bad code, not checking return codes.

  3. EATree uses objects on chart to save values — not persistent storage (files or GV+Flush.) No recovery (crash/power failure.)

  4. FX EA Builder makes bad code, not checking return codes.
    FX EA Builder makes bad code, loosing open tickets on terminal restart. No recovery (crash/power failure.)
    FX EA Builder makes bad code, not adjusting stops for the spread.
    FX EA Builder makes bad code, using OrdersTotal directly.

  5. FOREXEADVISOR STRATEGY BUILDER makes bad code, non-updateing global variables.
    FOREXEADVISOR STRATEGY BUILDER makes bad code, compilation errors.
    FOREXEADVISOR STRATEGY BUILDER makes bad code, not checking return codes.

Learn to code it, or pay someone (Freelance) someone to code it.
          Hiring to write script - General - MQL5 programming forum #1 2019.08.21

Reason: