Hi there,
Does anyone have any ideas about buying a bottom of a market, I’ve been experimenting with trying to create an algorithm that buys if the price falls candle after candle, then flattens out, and starts going back up.
For Example:
// Definition of code parameters
DEFPARAM CumulateOrders = False // Cumulating positions deactivated
// Conditions to enter long positions
c1 = (close < close[1])
c2 = (close < close[2])
c3 = (close < close[3])
c4 = (close < close[4])
c5 = (close < close[5])
c6 = (close < close[6])
//here is the market turning after a fall
c7 = (close > close[7])
c8 = (close > close[8])
IF c1 AND c2 AND c3 AND c4 AND c5 AND c6 AND c7 AND c8 THEN
BUY 1 PERPOINT AT MARKET
ENDIF
// Stops and targets
SET STOP pLOSS 5
SET TARGET pPROFIT 10
Would it be possible to incorporate a volume spike at the bottom too?
At the moment, the results are completely random.
When do you want to start buying the very first time?
Then you want to buy additional positions as it falls down?
When shall it exit?
[attachment file=”187470″]
See IMAGE
Exit will be a fixed amount of points, for example – 7 points
Thank you.
You are just looking for a V shaped bottom which may be the easiest to program but IMHO may not be the most bottom. I would look also for a W , reverse head&shoulders or better yet a 123 bottom, but those are difficult to detect by SW
Do you have the code for a V shaped bottom, please?
It only takes 3 candles to make a V, but how will you know if it’s likely to continue, or just a bounce within the previous trend?
You can’t do it with price action alone. Try adding a fast MA, for example:
ma = hullaverage[10](typicalprice) // can also be written ma = average[10,7]
long = ma > ma[1] and ma[1] < ma[2]
short = ma < ma[1] and ma[1] > ma[2]
On a 4 hour TF this is often a “fairly reliable” indicator of changes in the primary trend.