How to Put filter of 0.1% or 5 points in Buy Condition

#1
Ami Experts,

I have got one pivot trading afl from the net. I want to include Buy Sell condition with a filter of .1% in price. For e.g.

If Resistance = R1, R2, R3 and Supports = S1, S2 S3,

Then Buy = Cross (C, 1.1R1)

However, this buy should happen when price breaks out above R1 from below, and not when it is falling. The problem that I am facing is this woks well for the breakout. However, even if the price is falling from above R1, it gives me a Buy before price reaches R1, that is, at 1.1 R1.

Can any expert suggest how to overcome this problem?
 

manojborle

Well-Known Member
#2
Ami Experts,

I have got one pivot trading afl from the net. I want to include Buy Sell condition with a filter of .1% in price. For e.g.

If Resistance = R1, R2, R3 and Supports = S1, S2 S3,

Then Buy = Cross (C, 1.1R1)

However, this buy should happen when price breaks out above R1 from below, and not when it is falling. The problem that I am facing is this woks well for the breakout. However, even if the price is falling from above R1, it gives me a Buy before price reaches R1, that is, at 1.1 R1.

Can any expert suggest how to overcome this problem?
I think you can try adding condition L<R1 i.e

Buy = Cross(C, 1.1R1) AND L< R1;
 
#4
Thanks.

I tried Buy = (Cross (C, 1.1R1) AND Cross (C,R1)) and it seems to work fine. Thoug it is a crude method of doing tings. Also, it is missing some of the signals, have to check why.

Isn't there a better method of puuting a price filter for buying/ selling condition?
 

manojborle

Well-Known Member
#5
Thanks.

I tried Buy = (Cross (C, 1.1R1) AND Cross (C,R1)) and it seems to work fine. Thoug it is a crude method of doing tings. Also, it is missing some of the signals, have to check why.

Isn't there a better method of puuting a price filter for buying/ selling condition?
You can try this

Filter = C < R1 ;
Buy = Cross(C,1.1R1);

See whether it works ?
 
#7
I know now wy it is missing some signals if I use Buy = (Cross (C, 1.1R1) AND Cross (C,R1)).

I think what Ami is doing is that it is waiting for both the conditions to satisfy in a single bar. hence, if in a particular bar, the price crosses R1, but does not cros 1.1 R1, Ami is ignoring that signal. Even if price crosses 1.1 R1 in the next bar, the Buy signal is not formed. This is contrary to a normal filter, where we would simply Buy if price crosses 1.1 R1.
 
#8
Buy = Cross(C, 1.1R1) AND Cross(C, R1)

simply means that both crosses must happen at the very same bar to be a signal. The word cross already tells it. It must cross from below to above or from above to below at the same bar. Cross(C, R1) is different from C > R1. Cross can only be true at one bar of a timeframe but C > R1 can be true at multiple bars.
 
#9
Think of it like crossing the street. You cross the street "one" time (Cross(C, R1) or Cross(R1, C)) but you are on each side of the street multiple times longer (C > R1 or C < R1).
 
#10
Ami Experts,

I have got one pivot trading afl from the net. I want to include Buy Sell condition with a filter of .1% in price. For e.g.

If Resistance = R1, R2, R3 and Supports = S1, S2 S3,

Then Buy = Cross (C, 1.1R1)

However, this buy should happen when price breaks out above R1 from below, and not when it is falling. The problem that I am facing is this woks well for the breakout. However, even if the price is falling from above R1, it gives me a Buy before price reaches R1, that is, at 1.1 R1.

Can any expert suggest how to overcome this problem?
Buy = Cross (C, 1.1R1) means that a bar is crossing from below to above and not from above to below. If you want to check whether there was an up trend before then you could add a trend check for example