Download MetaTrader 5

How to use OpenLong function

To add comments, please log in or register
Write articles, help other developers and make money
rigorism
313
rigorism 2015.07.26 15:00 

Hi.

I am making an program to open position.

In this program, I want to use OpenLong function in CExpert.

But, this program can not compile by "cannot call protected member function" error.

Plese tell me how to correct this program.

//+------------------------------------------------------------------+
//|                                                         test.mq5 |
//|                                                      T.T   |
//|                                             https://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "T.T"
#property version   "1.00"
#include <Expert\Expert.mqh>
//+------------------------------------------------------------------+
CExpert ExtExpert;
//+------------------------------------------------------------------+
int OnInit(void)
   {
        return(INIT_SUCCEEDED);
  }

void OnDeinit(const int reason)
{
}

void OnTick()
{
double Ask = SymbolInfoDouble(Symbol(),SYMBOL_ASK);
Print(Ask);
ExtExpert.OpenLong(Ask,0,0);
}

Automated Trading and Strategy Testing
Automated Trading and Strategy Testing
  • www.mql5.com
MQL5: language of trade strategies built-in the MetaTrader 5 Trading Platform, allows writing your own trading robots, technical indicators, scripts and libraries of functions
Alain Verleyen
Moderator
30752
Alain Verleyen 2015.07.26 17:06  

https://www.mql5.com/en/forum/14482

All about MQL5 Wizard : create robots without programming.
All about MQL5 Wizard : create robots without programming.
  • www.mql5.com
What is MQL5 Wizard :The MetaTrader 5 Trading Platform includes the MQL5 Wizard, which allows to quickly generate code of an Expert Advisor (Expert Advisor builder). - - Category: general
To add comments, please log in or register