- ago
Can someone help me create a simple strategy with blocks?
Candle 1 is some kind of a doji, must have wicks.
Candle 2 must close above candle 1
Candle 3 buys limit at the high of candle 1
Sell at profit
Buying needs to happen on candle 3 or setup is not valid anymore.

0
241
Solved
13 Replies

Reply

Bookmark

Sort
- ago
#1
No need to limit yourself to Blocks. Despite their flexibility, this setup is not that simple to build there since you 1) key off to particular bars (say within the Multi-Condition Group) and 2) reset the setup. It would be simpler to come up with this in C# code.
0
- ago
#2
I asked in blocks because I can't code at all.
But thanks.
0
Glitch8
 ( 8.31% )
- ago
#3
I have to disagree with Eugene here, this one is pretty easy to model using Blocks.

I used the Candlestick Extension combined with a Qualifier to check for doji on bar 1 (1 bar before the signal bar)

I used Indicator Compare to Indicator to check the closing price of the singal bar (bar 2) compared to bar 1.

I used the Buy at Limit (are you sure you want Limit and not Stop?) set to the high of bar 1 using the OffsetInd to get the high of bar 1.

1
Best Answer
Cone8
 ( 3.70% )
- ago
#4
Here's one take on it. You need the Candlestick Genetic Evolver extension for the Candle Pattern rule.

If the doji isn't what you want, you can choose antoher, combine them, or invent your candle pattern > Help (F1) > Extensions > Candlesticks > Candle Codes

0
Cone8
 ( 3.70% )
- ago
#5
Glitch's use of OffsetInd is a better take on the limit order!
0
Glitch8
 ( 8.31% )
- ago
#6
I think my Post #3 is more correct since the poster wants to key off the high of bar 1, not the lowest as you have here.
0
- ago
#7
QUOTE:
I can't code at all.

I would find yourself a "local" partner to C#/C++ code some of the trickier stuff and to help you learn to code. For simple stuff, Blocks works. But for more intricate stuff, which you're interested in, coding is much easier.

Moreover, using code you can build local utility libraries to compute common tasks as Stop prices and such. And you'll have access to the plotting libraries (ScottPlot) and statistical libraries (Math.NET). This is the real power behind Wealth-Lab.
1
- ago
#8
I misread topic starter's notion, thinking that the buy should happen after bar #3 i.e. on bar #4. That's where my imaginary complexities in Post #1 were rooted.
0
Cone8
 ( 3.70% )
- ago
#9
QUOTE:
I think my Post #3 is more correct since the poster wants to key off the high of bar 1, not the lowest as you have here.
I already agreed, but the result is equivalent - the trigger bar's high will always be higher than the previous bar's high due to the setup. Therefore the limit price will be at the previous bar's high (the Lowest of the two highs).
0
Glitch8
 ( 8.31% )
- ago
#10
That's not true. If you run both strategies you'll see there are different entry prices for some of the trades because the Lowest(High, 2) sometimes gives the incorrect entry price.
0
Cone8
 ( 3.70% )
- ago
#11
It's different because a different rule that you used: "Close is greater than the Close of 1 bar ago".
Imho, that doesn't match the one requested "Candle 2 must close above candle 1". For that I used "Close is greater than the High of 1 bar ago".
0
Glitch8
 ( 8.31% )
- ago
#12
I could see how someone could interpret it that way, fortunately it’s easy to model either way.
0
- ago
#13
Thank you all!!
0

Reply

Bookmark

Sort