Inside Bar (Candle)
Author: thiagoinveste1307
Creation Date: 11/2/2020 11:32 PM
profile picture

thiagoinveste1307

#1
Hi Folks,

I'd like to configure my backtest using the insidecandle concept. In this model, the trading system will be configured following the steps bellow:

I) Buy at Market when:

The Maximum Actual Candle Price is smaller than the maximum
previous Candle Price

And

The Minimum Actual Candle Price is bigger than the minimum
previous Candle Price

And

The Closure Actual Candle Price is bigger than Exponential Moving Average (EMA) 80 periods.

Thanks, Best Regards
Thiago
profile picture

Eugene

#2
Hi Thiago,

Welcome and glad to see you're interested in Wealth-Lab!

I'm sure you can come up with a strategy like that yourself if you use the Rules Wizard. Add a Buy, then drop two conditions from "Price (or Volume) Action:

1. "Price increases a consecutive number of bars": use 1 for both number and lookback and choose Low
2. "Price decreases a consecutive number of bars": use 1 for both number and lookback and choose High

Finally, add your third condition from the "Moving Average" group:

3. "Price is above Moving Average"

P.S. Make sure to watch our educational videos on Youtube!

Wealth-Lab 101: Course Videos
profile picture

manobombo

#3
I'm looking for this exact same rule system, but the answer provided by @Eugene didn't work for me. I wanna buy at market if the previous candle is an inside bar, and the current candle crosses the inside bar's (previous candle) high.

Something like this:



The rules for an inside bar:
- High < Previous High
- Low > Previous Low

profile picture

Eugene

#4
Wealth-Lab has a flexible system of Rules. Check this out:

Rules > Conditions > Price (or Volume) Action

There's a number of conditions which let you build your trading setup with drag and drop like:

* Price is higher (lower) by $ / % as it was a number of bars ago
* Price < Lowest (> Highest) Price in prior period
etc.

Go for it!
profile picture

manobombo

#5
Hi, Eugene! I'm not being able to figure out how to achieve my goal here.

I'm using the following rules:
- Buy at stop Channel High (Channel Price: High, Period: 1)
-- Price >= Highest Price in prior period (Price 1: Low, Price 2: Low, Period: 1)
-- Price <= Lowest Price in prior period (Price 1: High, Price 2: High, Period: 1)
-- Price is higher by $ than it was a number of bars ago (Price: High, Period: 1, Value: 0,01)

As I said before, I want to buy if this scenario happens:


* The candle following the yellow candle (Inside Candle) crosses the Inside Candle's high.
profile picture

Eugene

#6
Hi,

The rules look correct. Can you be specific and show an example where you think something isn't working as you'd expect?

Please avoid using external image hosters. If you use the built-in attachments feature we'll never face dead screenshots again. Just click "Add Attachments", then after posting right-click the attached image and copy its URL, finally paste it inside a pair of IMG tags. I've attached your images to my post to keep them in the DB. Thanks.
profile picture

manobombo

#7
The problem is that when I run the strategy it doesn't execute a single trade.
profile picture

Eugene

#8
Please provide enough details to troubleshoot the issue:

1. Strategy or sample code used. Click "Open in a new code window" and copy/paste the code.
2. Symbol and Data provider
3. Position Sizing settings
4. Data Loading settings
5. Including a full-size screenshot is welcome.
This website uses cookies to improve your experience. We'll assume you're ok with that, but you can opt-out if you wish (Read more).