Rank: Member
Groups: Registered, Registered Users Joined: 10/6/2005(UTC) Posts: 26
|
Patrick wrote:Is there a way to make the Expert Advisor to only show the first long/short signal, not all of them?
Yes, there is, but it is fairly complex. It requires that your Expert formulas be reworked into what we tend to call a "flip-flop" construction. Here are two samples of this sort of construction:
3 state:
bc:=C > Mov(C,20,S)+1{enter long condition};
be:=Cross(Mov(C,20,S),C){close long condition};
sc:=C < Mov(C,20,S)-1{enter short condition};
se:=Cross(C,Mov(C,20,S)){close short condition};
trade:=If( bc=1, 1, If(sc=1, -1, If((be AND PREV=1)
OR (se AND PREV=-1),0,PREV)));
Cross( trade= x, 0.5)
You will need to change the Trade=X, in the above formulas to Trade= 1, Trade= -1, or Trade= 0, depending on the condition you are defining.
As you can see these are rather involved ...
Note: The PREV function used in these formulas is required, and it has the drawback of causing the calculation to be relatively slow.
Patrick,
I am actually working on the following system test/indicator to be replicated in Expert System. To-date, I have not managed to get the signs to match those in the Enhanced System Test. Would appreciate if you could give this problem a bit of your time.
bc:=C > LinearReg(C,12) and Qstick(10)>0+1{enter long condition};
be:=C<ref(llv(l,3),-1){close long condition};
sc:=C < LinearReg(C,12) and Qstick(10)<0-1{enter short condition};
se:=C>ref(hhv(h,3),-1){close short condition};
trade:=If( bc=1, 1, If(sc=1, -1, If((be AND PREV=1)
OR (se AND PREV=-1),0,PREV)));
Cross( trade= x, 0.5)
How do I move on from here? What number is x for bc,be,sc and se to get the symbols to appear on the Expert System. Appreciate any help you could extend.
TQ
|