double TakeProfit;
int init()
{
//----
//----
return(0);
}
//+------------------------------------------------------------------+
//| expert deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----
//----
return(0);
}
//+------------------------------------------------------------------+
//| expert start function |
//+------------------------------------------------------------------+
int start()
{
if (condition) {order(); trailing();}
}
//----
return(0);
//+------------------------------------------------------------------+
void order()
{
double entry = high[1]+point
TakeProfit = entry+high[1] - low[1]
sendorder...
}
void trailing()
{
OrderModify(OrderTicket(),OrderOpenPrice(),Bid-Point*TrailingStop,TakeProfit,0,Blue)
}
So i declared TakeProfit as a global variable,
But a value was assigned to it in the function caller order().
Now can I call that value(TakeProfit) in another function called trailing() without having to assign a value again to TakeProfit.
Cheers
Brijesh
int init()
{
//----
//----
return(0);
}
//+------------------------------------------------------------------+
//| expert deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----
//----
return(0);
}
//+------------------------------------------------------------------+
//| expert start function |
//+------------------------------------------------------------------+
int start()
{
if (condition) {order(); trailing();}
}
//----
return(0);
//+------------------------------------------------------------------+
void order()
{
double entry = high[1]+point
TakeProfit = entry+high[1] - low[1]
sendorder...
}
void trailing()
{
OrderModify(OrderTicket(),OrderOpenPrice(),Bid-Point*TrailingStop,TakeProfit,0,Blue)
}
So i declared TakeProfit as a global variable,
But a value was assigned to it in the function caller order().
Now can I call that value(TakeProfit) in another function called trailing() without having to assign a value again to TakeProfit.
Cheers
Brijesh