Inputs Tab Disappear

 

greating,


I have an external inputs variable for me indicator, it will prompt the inputs tab when i add the indicator to chart. however when i added my libraries function  call (#include),

the input tab will disappear when i add the indicator to chart. please help, thanks


#include "C:\Program Files\Interbank FX Trader 4\experts\libraries\Myfunction.mq4"


#property indicator_chart_window

#property indicator_buffers 2

#property indicator_color1 Aqua

#property indicator_color2 Magenta


//---- input parameters

extern bool Flag=true;


 
stanleylai wrote >>

greating,

I have an external inputs variable for me indicator, it will prompt the inputs tab when i add the indicator to chart. however when i added my libraries function call (#include),

the input tab will disappear when i add the indicator to chart. please help, thanks

#include "C:\Program Files\Interbank FX Trader 4\experts\libraries\Myfunction.mq4"

#property indicator_chart_window

#property indicator_buffers 2

#property indicator_color1 Aqua

#property indicator_color2 Magenta

//---- input parameters

extern bool Flag=true;

try this #property show_inputs;

 

added #property show_inputs, but the inputs tab still not show.

//---- input parameters

#property show_inputs

extern bool Flag=true;

 

Add some new extern parameter and check result

 

added fews more, the result still the same.

//---- input parameters

#property show_inputs

extern int Test1=1;

extern bool Flag=true;

extern bool Flag2=true;

 

remove #property library from your include file

 

after removed the #property library, i get warnings during compilation. however it solved the problem. many thanks.

i.e. Function "IsInsideBar" is not referenced and will be removed from exp-file.

what this warning mean & #property library is for what purpose?

 

https://docs.mql4.com/index

Library is a set of custom functions containing programs most frequently used. Libraries cannot start execution by itself.
Libraries are recommended to be stored in terminal_directory\experts\libraries.

https://docs.mql4.com/basis/preprosessor/compilation

library a library; no start function is assigned, non-referenced functions are not removed

 

Hi


I have a similar problem, where I see no input tab in the properties window at all in my EA. Example EAs that were supplied with MetaTrader do show inputs in the properties window, but not mine. Here is the header part of my EA. I've tried adding the line #property show_inputs, but it had no apparent effect. I suspect I've missed something simple. I'd appreciate any ideas.


Thanks

Jellybean


//--------------------------------------------------------------------
// Global declarations
//--------------------------------------------------------------------
#property copyright "Jellybean"
#property show_inputs

#include "libraries\stdlib.mq4"
#include "libraries\AJSLib.mq4"

//Trading Parameters.
//#define  SPREAD_RATIO 5.0              // Limit for spread size c.f. band width
#define  MA_PER  5                     // Periods for averaging the high & lows
#define  SL_FACTOR  0.50               // Factor of range for stop loss distance
//#define  TP_FACTOR  0.50               // Factor of range for target distance
#define  MAXSLIPPAGE  2                // In 4- or 2-digit points

// Parameter definitions
#define  LONG  1                       // trade directions
#define  SHORT -1

// Position risk management
//#define  MAXRISK  50.00                // Maximum risk amout in account currency
#define  RISKPERCENT  1.0              // Maximum risk percentage of equity
#define  MAXMARGIN  1000.00            // Maximum margin cost in account currency

// Input parameters for optimisation
extern double TPFactor = 0.50;         // Factor of range for target distance
extern double Range2Spread = 5.0;      // Limit for spread size c.f. band width

// Trade and position details
int Ticket = -2;                       // Ticket number of open position. (-2 = no position)
int Direction = 0;                     // Direction of the trade
double StopLoss = 0;                   // Stop-loss price
double Target = 0;                     // Target price (take profit)
double MaxSlip = MAXSLIPPAGE;          // Maximum slippage
double RiskAmt;                        // Risk amount in account currency for position size calculation

 
stanleylai wrote >>

greating,

I have an external inputs variable for me indicator, it will prompt the inputs tab when i add the indicator to chart. however when i added my libraries function call (#include),

the input tab will disappear when i add the indicator to chart. please help, thanks

#include "C:\Program Files\Interbank FX Trader 4\experts\libraries\Myfunction.mq4"

#property indicator_chart_window

#property indicator_buffers 2

#property indicator_color1 Aqua

#property indicator_color2 Magenta

//---- input parameters

extern bool Flag=true;

I was also having a problem but I realised I was making a mistake in how I structured my code. I was putting all my function code into the include file and had the #property library at the top. Funnily enough it still worked fine until I wanted to access the inputs tab of the EA. What I did was to create two separate files - an Include file and a Library file. Similiar to this:

Include file in "Include" folder:- My_Tools.mq4

#property copyright

#property link

#import "My_Tools.ex4" //this line is required to reference library file


double Position_Size_Calc(double Stop_Loss_Price, int Stop_Loss_Pips, int Risk_Percent);
double Split_Amount(double Order_Lots,int Split_Percent);

.

.

Library file in "Library" folder:- My_Tools.ex4

#property copyright

#property link
#property library //this line is necessary to prevent MT4 from "thinking" it's a normal EA/indicator/script file. Without this you'll get "Function "X/Y" is not referenced and will be removed from exp-file"

// errors.


double Position_Size_Calc(double Stop_Loss_Price, int Stop_Loss_Pips, int Risk_Percent)
{

// CODE CODE CODE

// CODE CODE CODE


return (Lots);
}

double Split_Amount(double Order_Lots,int Split_Percent)
{

// CODE CODE CODE

// CODE CODE CODE

return (Split_Lots);
}

Reason: