some error about mt5 report,help

 
'OrderSymbol' - undeclared identifier	mq1.mq5	219	50
'OrderSelect' - wrong parameters count	mq1.mq5	165	13
'OrderType' - undeclared identifier	mq1.mq5	167	58
'OrderSymbol' - undeclared identifier	mq1.mq5	176	34
'OrderVolume' - undeclared identifier	mq1.mq5	177	34
'OrderTicket' - undeclared identifier	mq1.mq5	179	36
'OrderSymbol' - undeclared identifier	mq1.mq5	180	50
'OrderSelect' - wrong parameters count	mq1.mq5	204	13
'OrderVolume' - undeclared identifier	mq1.mq5	216	34
'OrderTicket' - undeclared identifier	mq1.mq5	218	36
'OrderSymbol' - undeclared identifier	mq1.mq5	219	50

why tips me the wrongs above?how to solve?
//+------------------------------------------------------------------+
//|                                                      MarketStateAndTrade.mq5 |
//|                        Copyright 2024, MetaQuotes Software Corp.      |
//|                                       https://www.mql5.com           |
//+------------------------------------------------------------------+
#include <Trade\Trade.mqh>
#include <Trade\SymbolInfo.mqh>

// 输入参数
input int lookbackPeriod = 30;  // 回溯周期
input int volatilityThreshold = 10;  // 波动率阈值(百分比)
input double lotSize = 0.1;  // 交易手数

// 全局变量
double lastMaxHigh = 0.0;
double lastMinLow = 0.0;

#define SELECT_BY_POS 1
#define OrderSymbol() OrderSymbol
#define OrderTicket() OrderTicket
#define OrderVolume() OrderVolume 
#define OrderType() OrderType
Discover new MetaTrader 5 opportunities with MQL5 community and services
Discover new MetaTrader 5 opportunities with MQL5 community and services
  • 2024.10.29
  • 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
 
Traders and coders are coding for free:
  • if it is interesting for them personally, or
  • if it is interesting for many members of this forum.

Freelance section   of the forum should be used in most of the cases.

Trading applications for MetaTrader 5 to order
Trading applications for MetaTrader 5 to order
  • 2024.10.29
  • www.mql5.com
The largest freelance service with MQL5 application developers
 
Your topic has been moved to the section: Expert Advisors and Automated Trading
Please consider which section is most appropriate — https://www.mql5.com/en/forum/172166/page6#comment_49114893
 

Hi

You cannot define those mt4 functions in mt5 and use them later. I assume you use those functions somewhere in the code to trade or manage positions and trades, but it’s not allowed in mql5.

You need to use proper classes and functions from the library you included like: CPositionInfo and methods for it: SelectByIndex, Symbol, Volume, PositionType etc.

Have a nice day👍📊