ww58
- ago
Suppose we want to trade this pattern, for example, to enter after a pullback. What tool or algorithm is easier to solve this?

PriceGrid does not take into account the distance between candles, so it will not help especially for small timeframes.
PriceGrid TS + Zigzag won't help either, because we don't know how long the consolidation phase will last and it won't be able to determine the pullback.
And both of these options will not take into account how close the pullback was to the moving, which can cause false entries.
Sometimes an upward consolidation breakout can be as here, sometimes it'll be a few bars so I consider it overengineering to do all this in raw c# code.
0
186
6 Replies

Reply

Bookmark

Sort
- ago
#1
Well, that's kind of hard to discuss without any price or time axis labeling, or whatever the blue line is which seems to be a moving average.
0
ww58
- ago
#2
I didn't put scales for a reason, it is important for me to understand the principle of how best to implement, not to implement a particular pattern. The blue line is a moving average, but it can also be just a level. Specifically here we see that there was a false breakdown down after a consolidation , then a small consolidation and the price breaks up, then again consolidation, pullback and upward price movement. My task is to implement this algorithm.
0
Glitch8
 ( 11.29% )
- ago
#3
I would go with a PriceGrid, I'm not sure why you think it would not help.
0
ww58
- ago
#4
QUOTE:
I would go with a PriceGrid, I'm not sure why you think it would not help.
Because the consolidation phase can be 4 bars but can be 10 or more bars, as well as pullback can be right up to the moving average, or it can not reach the moving avg as here. Such differences on a small timeframe will give a lot of garbage trades. PriceGrid doesn't understand what is critical to the setup and what isn't, it looks at the picture overall. It's impossible to make it only look at the price scale, but not at the time scale.
0
Glitch8
 ( 11.29% )
- ago
#5
Maybe a custom Chart Pattern for the Chart Pattern extension would be a better fit. I’ll see if I can come up with something there.
1
- ago
#6
QUOTE:
we want to trade this pattern,... to enter after a pullback

I see a 3-state pattern here. A consolidation [state 1], followed by a significant pullback [state 2], followed by a stop Buy entry [state 3]. I'm not sure how high you want to set the stop Buy to avoid false entries.

But for a 3-state pattern, why can't you do this is C#? The first and second state can be detected* in the Initialize{block} and the third state has to be left for the Execute{block}.

*By "detected", I mean queued up in Initialize so it can be later processed (dequeued) in Execute for analysis. Understand, just because the activity passes the first two states doesn't mean it's time to place a stop Buy in Execute. You may want to see if a few other "plants" (i.e. indicators) line up before pulling the trigger in Execute.

.NET has a FIFO queuing datatype you can use to collect pattern candidates that successfully pass states 1 and 2 that are queued in Initialize. Execute can then dequeue each candidate when it gets to its appropriate bar. There's a Peek method to check if the next element leaving the FIFO queue would be the bar Execute is currently on before dequeuing it. This approach does require a competent C# programmer that can manage elements on the FIFO queue, but it's not that hard. I usually reference a "struct" object of pattern-merit attributes on each queue element as well so I know something about that particular pattern opportunity; not all confirmed patterns have the same merits.

The PeakTroughCalculator works on a similar principle. It populates its doubly-linked list of PeakTroughs in Initialize, then you can examine that list (along with its PeakTrough attributes) in Execute to place your trades.

---
It may take several stop Buy attempts before the stop Buy fills; therefore, dequeuing needs to be done by either the Position-open code (after there's a confirmed fill), or in the Position-closed code after the stop Buy opportunity ages out (never fills).
1

Reply

Bookmark

Sort