Rank: Advanced Member
Groups: Registered, Registered Users Joined: 2/19/2012(UTC) Posts: 106
Thanks: 1 times Was thanked: 1 time(s) in 1 post(s)
|
A buy using De Mark's Differential indicator must fulfill the following conditions
The following are the conditions necessary to produce an up arrow: 1. There must be two consecutive closes, each one less than the one prior, 2. Buying pressure for the current price bar must exceed buying pressure from the previous price bar, and 3. Selling pressure for the current price bar must be less than selling pressure from the previous price bar.
Where Buying pressure is defined as the difference between the close of the current price bar and its true low (the true low is the lesser of either the current bar’s low or the previous price bar’s close and
Selling pressure is represented by the difference between the close of the current bar and its true high (the true high is the greater of the current price bar’s high or the previous price bar’s close).
I coded it in the expert advisor using a graphic up arrow for the buy with condition:-
Cond1:=(C<Ref(C,-1)AND Ref(C,-1)<Ref(C,-2));
TL:=(If(L<Ref(C,-1),L,If(Ref(C,-1)<L,Ref(C,-1),L))); BP:=(C-TL); TLP:=(If(Ref(L,-1)<Ref(C,-2),Ref(L,-1),If(Ref(C,-2)<Ref(L,-1),Ref(C,-2),Ref(C,-2)))); BPP:=(Ref(C,-1)-TLP); TH:=(If(H>Ref(C,-1),H,If(Ref(C,-1)>H,Ref(C,-1),H))); THP:=(If(Ref(H,-1)>Ref(C,-2),Ref(H,-1),If(Ref(C,-2)>Ref(H,-1),Ref(C,-2),Ref(C,-2)))); SP:=(C-TH); SPP:=(Ref(C,-1)-THP); Cond2:=(BP>BPP); Cond3:=(SP<SPP); Cond1 AND Cond2 AND Cond3
Where TL=True low; TLP=True low of previous bar similarly TH=True High THP=True High previos bar BP=Buying pressure; BPP=Buying pressure previous bar SP=Selling pressure;SPP=Selling pressure previous bar
It works but gives some false signals uncharacteristic of De Mark indicators.
I think my coding has some errors---can someone help?
Regards, Dr.Chatterjee
|