Download MetaTrader 5
To add comments, please log in or register
Manage agents in your profile. It is easy!
stanislass
63
stanislass 2015.11.30 18:22 
Hello

I want this EA launches with default with Type = NO_ORDER, but each time it launches with the last parameter used.
Is it possible?

Thank you
#property copyright "Copyright 2014, MetaQuotes Software Corp."
#property link      "https://www.mql5.com"
#property version   "1.00"
#property strict


input ENUM_TIMEFRAMES TimeSAR = PERIOD_CURRENT;
extern int Offset = 0;
enum choix {BUY = OP_BUY,SELL = OP_SELL,NO_ORDER = 6};
input choix Type = NO_ORDER;
extern double Lot = 0;
extern double Stop = 0;
extern double Take = 0;
extern int Magic = 0;
extern string Info = "SARTrak";
extern int Slippage = 3;

int total;
double ministop,newstop,oldstop=0.0;

//+------------------------------------------------------------------+
//| Expert initialization function                                   |

Vasyl Nosal
18213
Vasyl Nosal 2015.11.30 22:32  
NO_ORDER = 6
maybe 
NO_ORDER = -1
whroeder1
13627
whroeder1 2015.12.01 13:39  
stanislass: it launches with the last parameter used.
That is what it does, for objects, indicators, and EAs. Just press the Reset button.
stanislass
63
stanislass 2015.12.01 15:33  
WHRoeder:
stanislass: it launches with the last parameter used.
That is what it does, for objects, indicators, and EAs. Just press the Reset button.

OK. So as I understand it, no need to specify a default value.

Thank you
/
To add comments, please log in or register