I have implemented a trend filter with "data2" being the weekly timeframe on the same future. It says "If we have had, on the previous week, rising/falling prices with rising volumes then only allow long/short trades for this coming week". However, it also implies that if we had falling volumes on the previous week, the system will stay flat, no matter what, for the whole coming week. And this is not what I want, because volumes can't rise forever. Let's say we have 8 rising weeks - they can't be 8 weeks of constantly rising volumes, and yet the trend is up for all these 8 weeks, and we should be able to accept long signals from our system.
So my question is this - how do I tell the system to accept long/short signals if we are in a positive/negative trend, and at the same time establish the trend with this rule - "if we have a reversal in the direction of price (on a weekly basis), then reverse the trend only if it comes with rising volumes, otherwise keep the previous trend position, no matter what volumes you get".
Basically, I want to say "If we have no reversal in price, stay with the previous trend, no matter what the volume is, and the previous trend is one that only gets established by a reversal in prices coming with increasing volumes". Right now, instead, in a trend in price that's several weeks long, the system stays flat unless it gets ever rising volumes, which is impossible.
Inputs: FastLength(x), SlowLength(y), PercentTarget(w), PercentRisk(z),
TS1_Start(a), TS1_Stop(b), TS2_Start(c), TS2_Stop(d), TS3_Start(e), TS3_Stop(f);
Variables: TimeAll(0), Fast(0), Slow(0);
...
{*** entries ***}
If (MarketPosition <> 0 And Openpositionprofit > (AbsValue(EntryPrice) * PercentTarget)) Or (MarketPosition = 0) Then
Begin
If CurrentBar > 1 And Fast Crosses Above Slow And TimeAll = 1 And (c of Data2 > c[1] of Data2 and v of Data2 > v[1] of Data2) Then
Buy This Bar;
If CurrentBar > 1 And Fast Crosses Below Slow And TimeAll = 1 And (c of Data2 < c[1] of Data2 and v of Data2 > v[1] of Data2) Then
Sell This Bar;
end;
{*** exits ***}
...
{*** stoploss ***}
...
So my question is this - how do I tell the system to accept long/short signals if we are in a positive/negative trend, and at the same time establish the trend with this rule - "if we have a reversal in the direction of price (on a weekly basis), then reverse the trend only if it comes with rising volumes, otherwise keep the previous trend position, no matter what volumes you get".
Basically, I want to say "If we have no reversal in price, stay with the previous trend, no matter what the volume is, and the previous trend is one that only gets established by a reversal in prices coming with increasing volumes". Right now, instead, in a trend in price that's several weeks long, the system stays flat unless it gets ever rising volumes, which is impossible.
Inputs: FastLength(x), SlowLength(y), PercentTarget(w), PercentRisk(z),
TS1_Start(a), TS1_Stop(b), TS2_Start(c), TS2_Stop(d), TS3_Start(e), TS3_Stop(f);
Variables: TimeAll(0), Fast(0), Slow(0);
...
{*** entries ***}
If (MarketPosition <> 0 And Openpositionprofit > (AbsValue(EntryPrice) * PercentTarget)) Or (MarketPosition = 0) Then
Begin
If CurrentBar > 1 And Fast Crosses Above Slow And TimeAll = 1 And (c of Data2 > c[1] of Data2 and v of Data2 > v[1] of Data2) Then
Buy This Bar;
If CurrentBar > 1 And Fast Crosses Below Slow And TimeAll = 1 And (c of Data2 < c[1] of Data2 and v of Data2 > v[1] of Data2) Then
Sell This Bar;
end;
{*** exits ***}
...
{*** stoploss ***}
...