You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Hi there,
I wonder if someone has some code or can develop a code with the following conditions: (trend following)
Moving Average:
- Period: 90
- Shift: 0
- Mode: Simple
The code must test the candlestick bar status for 2 different timeframes: 1H and 4H
Rules:
NO ORDER: Wait for the candlestick cross the MA on 1H time frame
BUY: When there is a candlestick totally above the MA on 1H time frame (lower price of candlestick of the closed bar above the MA) it must check on 4H timeframe if the candlestick is also totally above the MA (lower price of candlestick of the closed bar above the MA).
SELL: When the candlestick totally bellow the MA on both 1H and 4H time frames.
So, I need:
- A function that returns a value if the NO ORDER condition is found;
- A function that, when NO ORDER condition is false, returns another value when the candlestick is totally above MA on both 1H and on 4H
- A function that, when NO ORDER condition is false, returns another value when the candlestick is totally bellow MA on both 1H and on 4H
Can anyone help me?
Regards