# EA problem.

45

if close-open >0.01 on H4 chart,then we were in up trend. if close-open < -0.01 on H4 chart,then we were in down trend.

if close-open >0.005 on H1 chart,then we send buy order(buy signal). if close-open < -0.005 on H1 chart,then we send buy order(sell signal).

Before I run the EA how can I tell EA that we already in up trend(by myself, not the code) ,just waiting the buy signal?

I use extern double trend =1,but if the trend change into down trend after 2 H4 bar,EA still shows up uptrend =1.

How can I tell ea to ignore the trend stasus I defined.

16398

sunyc1982:

if close-open >0.01 on H4 chart,then we were in up trend. if close-open < -0.01 on H4 chart,then we were in down trend.

if close-open >0.005 on H1 chart,then we send buy order(buy signal). if close-open < -0.005 on H1 chart,then we send buy order(sell signal).

Before I run the EA how can I tell EA that we already in up trend(by myself, not the code) ,just waiting the buy signal?

I use extern double trend =1,but if the trend change into down trend after 2 H4 bar,EA still shows up uptrend =1.

How can I tell ea to ignore the trend stasus I defined.

post your code if you need help.

44

Up and Dn is often used in indicators when are in need 2 different arrows (example), you don't need 2 variables for trend, it can be only one, not 2. Example:
```string signal[] = { "Up detected", "Down detected", "no-trend" };
int trend = 0;
extern int filter = 5;

int CheckTrend() {
if ( price > OpenN + filter * Point ) trend = OP_BUY;
else if ( price < OpenX - filter * Point ) trend = OP_SELL;
else trend = 2;
return( trend );
}
void start() {
Print(signal[CheckTrend()]);
}
```

From your text I understand that. If you want to define that up-trend is from start, simply write:

`int trend = OP_BUY;`