Extern variables

 

I have this code in my indicator: #include "C:\Program Files\GKFX MetaTrader 4\MQL4\Libraries\htmcode.mq4"

is it possible to set this path as Extern variables so that I can change it externally?

 
It's not possible, #include is a preprocessor directive and therefore the compiler must know which file you want to include, and it can't be changed later. Why did you want to do that???. Regards.
 
Jose Francisco Casado Fernandez:
It's not possible, #include is a preprocessor directive and therefore the compiler must know which file you want to include, and it can't be changed later. Why did you want to do that???. Regards.

Hallo thanks,

I want to share my indicator as Demo for one or two Month. and this Path must be changed individually.

would you please let me Know also, how can I code my file to share it as Demo for one or two Month.

 
bah12ram:

I want to share my indicator as Demo for one or two Month. and this Path must be changed individually.

would you please let me Know also, how can I code my file to share it as Demo for one or two Month.

Why the path must be different? Usually, all paths in the teminal sandbox is standard. In your product use #include to include a header mqh-file for your library, which in turn will be always searched for and loaded from the \libraries subfolder. You may embed time limitation into the library.
 
As a workaround, you may code your indicator in 2 parts: 1) front-end indicator and 2) worker back-end indicator. In the front-end indicator you can provide an input string parameter with the name of the back-end indicator (will be called via iCustom). All calculations should be perfromed in 2) while 1) should display results on the chart.
Reason: