Hi guys,
Please can someone help me with some fresh ideas as I have a couple of different reliable strategies but am unable to fully automate them when the price is bouncing around the top of market, positioning trigger is otherwise right but I will normally exit them early in profit to avoid the inevitable retracement into drawdown.
DJI and NIK on a 3min tf would be particularly helpful if I could add a bit of code that would avoid that top range. I’ve tried fibonacci levels, ranges and a few other things but no luck without seriously battering the gain. Last resort would be manually adding the upper resistance price level and working back from that but it would need to be regularly adjusted so was hoping for something a bit more dynamic?
Thanks in advance.
Kovit
The first thing to do is how to determine a top and a bottom.
As you can see from the attached pic, it all depends on the lookback period… around the top of the last 30 bars, 300 bars or 3000 bars?
Once set the lookback period, you need to define AROUND as well. Is AROUND the bottom in that same lookback period? or is it a percentage from the top (at your will or calculated using fibo retracement levels)? or is it a custom number of pips?
Your eyes can easily define all above info, but code cannot, so you have to set rules using accurate numbers to help it detect what you want.
Hi Roberto,
Thanks for getting back to me so quickly, for me as I tend to be quite risk averse and prefer to build in more of a buffer it would be the 35100 resistance level or even flat 35000 for simplicity sake.
Thanks
Kovit
Maybe I’m over complicating things as it won’t do me any harm to check the charts every day and have a fixed upper resistance price and adjust it as necessary as the market fluctuates.
I can code this:
- calculate the highest price within the last N bars
- determine on which lower HUNDRED (final 00) level it sits
- subtract 100 pips from that level (but you can change that number, 1=100, 2=200, etc…)
This is an indicator to add ON the price chart:
N = 300 //lookback periods
hh = highest[N](high) //highest price since then
HL = (round((hh / 100) - 0.5) - 1) * 100 //replace 1 with any number, even 0.5
Return HL as "Hundred Level"
This example will enter a Long trade when long conditions are met, provided the price is BELOW the HL:
DEFPARAM CumulateOrders = false
N = 300 //lookback periods
hh = highest[N](high) //highest price since then
HL = (round((hh / 100) - 0.5) - 1) * 100 //HL = Hundred Level
MyLongConditions = Not OnMarket AND close CROSSES OVER average[20]
IF MyLongConditions AND close < HL THEN
BUY AT Market
ENDIF
SET STOP pLOSS 30
SET TARGET pPROFIT 60
That looks perfect and just what I needed, a million thanks Roberto, I’ll add it in now.