Three indicators have triggered but not at the same time
Author: giorgos
Creation Date: 2/12/2010 12:02 PM
profile picture

giorgos

#1
I would like to buy/sell if the three indicators have triggered without reversing but they dont have to trigger in the same bar as the code below.

Can you please suggest how to do this. I do not know programming

CODE:
Please log in to see this code.
profile picture

Eugene

#2
Seems like I understand your request, but could you be more specific regarding:

1) When do they have to trigger? The signals can be scattered e.g. a crossunder at bar 30 followed by a crosover at bar 33 and the setup finishes at bar 41 with the final crossover, but what's the maximum range (proximity)?
2) Does that matter which signal happens first? Should they happen in the order of your code?
profile picture

giorgos

#3
Order does not matter as long as the all have trigered signalling a buy ,than I want to buy on the last signal trigerring.

Similarly on the sell want to sell when the lsat one trigers provided the other have sinalled a sell.

Although the range should not matter a period of 50 bars should be suffecient
profile picture

Eugene

#4
OK. I'll take a look at coding this when time permits.
profile picture

Eugene

#5
Here's your "fuzzy crossover" idea. With RSI at 80 and 20 it doesn't generate any trades for me, so I defined the Strategy Parameters for proximity (i.e. range), RSI overbought and oversold levels.
CODE:
Please log in to see this code.
profile picture

giorgos

#6
Thanks, very useful especially when trying it with other indicators although not exactly what I wanted.

My intent is that all three indicator must stay in the same state with out crossing in the other direction in order to buy or sell.

Thanks again
profile picture

Eugene

#7
In this case, you could probably add the opposite condition check to each indicator from the group. Like if when you enter, the program checks for a SMA crossunder within N bars (CrossUnderWithin...) - so check that no CrossOverWithin happened.
This website uses cookies to improve your experience. We'll assume you're ok with that, but you can opt-out if you wish (Read more).