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.
Size:
Color:
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?
Size:
Color:
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
Size:
Color:
OK. I'll take a look at coding this when time permits.
Size:
Color:
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.
Size:
Color:
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
Size:
Color:
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.
Size:
Color: