PureBytes Links
Trading Reference Links
|
Hi there
I wonder if someone can help me solve this annoying problem.
I have got an indicator which can produce a signal mid way through the bar.
When a buy signal is created a variable is set to 1 if a sell is created
variable is set to 2 when there is no signal I want the variable= 0, the
code I have so far is below:
If (condition9 and MRO(condition9 = TRUE, 3, 2) = - 1 and (((MODE = 1) OR
(MODE = 2)) OR MODE = 7)) OR (BuyOK and SellOK[1] = TRUE and (((MODE = 4) OR
(MODE = 6)) OR MODE = 7)) OR (condition1 and condition1[1] = FALSE and
SellOK[1] = TRUE and (((MODE = 5) OR (MODE = 6)) OR MODE = 7)) OR
(SellOK1[1] = TRUE and condition1 and condition1[1] = FALSE and (((MODE = 5)
OR (MODE = 6)) OR MODE = 7)) then signals = 1; {a buy signal}
If (condition10 and MRO(condition10 = TRUE, 3, 2) = - 1 and (((MODE = 1) OR
(MODE = 3)) OR MODE = 7)) OR (SellOK and BuyOK[1] = TRUE and (((MODE = 4) OR
(MODE = 6)) OR MODE = 7)) OR (condition2 and condition2[1] = FALSE and
BuyOK[1] = TRUE and (((MODE = 5) OR (MODE = 6)) OR MODE = 7)) OR (BuyOK1[1]
= TRUE and condition2 and condition2[1] = FALSE and (((MODE = 5) OR (MODE =
6)) OR MODE = 7)) then signals = 2; {a sell signal}
This is were I have the problem, I need to set signal = 0 when none of the
above are producing a signal and however I phrase it, it never seems to
work. Has anyone got an idea how it could be done
Thanks
Mark
|