Hi.
I want to define a doji as a Candlestick (CS) when Open differs from Close by 0,2% or less.
I don't want to trade on Dojis, and I want to exclude them from N bars ago.
Lets say I want to trigger a signal after 3 consecutive down days. I find 3 consecutive down days but one of them is a Doji. Then it should'nt trigger. Is this doable in Building Blocks?
2nd Scenario.
I find 3 consecutive down days, but one of them is a "green CS", meaning a CS where Close is higher than Open. It should'nt count as well.
Sometimes I like to count specific CS rather than consecutive Higher or Lower bars.
Example, find 3 latest green bars above indicator, not counting Dojis, Hammers, Red bars etc ..
Cheers.
I want to define a doji as a Candlestick (CS) when Open differs from Close by 0,2% or less.
I don't want to trade on Dojis, and I want to exclude them from N bars ago.
Lets say I want to trigger a signal after 3 consecutive down days. I find 3 consecutive down days but one of them is a Doji. Then it should'nt trigger. Is this doable in Building Blocks?
2nd Scenario.
I find 3 consecutive down days, but one of them is a "green CS", meaning a CS where Close is higher than Open. It should'nt count as well.
Sometimes I like to count specific CS rather than consecutive Higher or Lower bars.
Example, find 3 latest green bars above indicator, not counting Dojis, Hammers, Red bars etc ..
Cheers.
Rename
>>I want to define a doji as a Candlestick (CS) when Open differs from Close by 0,2% or less. I don't want to trade on Dojis, and I want to exclude them from N bars ago.
Lets say I want to trigger a signal after 3 consecutive down days. I find 3 consecutive down days but one of them is a Doji. Then it should'nt trigger. Is this doable in Building Blocks?<<
I added a new Condition to the Candlestick extension to facilitate this. It resolves to true if the current bar is NOT the selected Candlestick pattern. You can use the Candlestick Extension preferences to change the "Equality Thresold" to 0.2, then this will work. You'll need to wait for the next release cycle and Candlestick extension Build 9.
Lets say I want to trigger a signal after 3 consecutive down days. I find 3 consecutive down days but one of them is a Doji. Then it should'nt trigger. Is this doable in Building Blocks?<<
I added a new Condition to the Candlestick extension to facilitate this. It resolves to true if the current bar is NOT the selected Candlestick pattern. You can use the Candlestick Extension preferences to change the "Equality Thresold" to 0.2, then this will work. You'll need to wait for the next release cycle and Candlestick extension Build 9.
>>I find 3 consecutive down days, but one of them is a "green CS", meaning a CS where Close is higher than Open. It should'nt count as well.<<
Use Indicator Compare to Indicator, Close <= Open, with the 3 times within 3 bars Qualifier.
Use Indicator Compare to Indicator, Close <= Open, with the 3 times within 3 bars Qualifier.
>>Example, find 3 latest green bars above indicator, not counting Dojis, Hammers, Red bars etc ..<<
There's really no good way to count occurrences and then take an action like this within a BB strategy, but here it is in code:
There's really no good way to count occurrences and then take an action like this within a BB strategy, but here it is in code:
CODE:
using WealthLab.Backtest; using System; using WealthLab.Core; using WealthLab.Indicators; using WealthLab.Candlesticks; namespace WealthScript2 { public class MyStrategy : UserStrategyBase { public override void Initialize(BarHistory bars) { sma20 = SMA.Series(bars.Close, 20); PlotIndicator(sma20); cp = CandleGeneDecoder.FindPattern("Neutral Doji"); } //find third green bar above SMA public override void Execute(BarHistory bars, int idx) { if (bars.Close[idx] > sma20[idx]) { //exclude doji if (CandleGeneDecoder.DetectPattern(bars, idx, cp)) return; //green bar? if (bars.Close[idx] > bars.Open[idx]) { count++; if (count == 3) { SetBackgroundColor(bars, idx, WLColor.Green.MakeTransparent(32)); } } } else count = 0; } //private variables private int count = 0; private SMA sma20; private CandleGenePattern cp; } }
Candlestick Extension Build 9 is released with the new Condition referred to above.
Thanks, looking great. Looking forward to it :)
I don't have premium yet. Is it the "Candlestick Genetic Evolver" extension that I should purchase?
Thanks in advance
I don't have premium yet. Is it the "Candlestick Genetic Evolver" extension that I should purchase?
Thanks in advance
Yes that’s the one.
Is "ConsecDown" included in Base application or any extension? I can not find it.
I have Powerpacks and Candlesticks only extensions so far.
Cheers
I have Powerpacks and Candlesticks only extensions so far.
Cheers
Yes it’s in the base. Show us a screen shot of where you are looking. It’s in there.
I found it amongst the indicators. I thought it was a Building block. My mistake.
Your Response
Post
Edit Post
Login is required