Introduction to Logic Construction⭐︎
“I want to create my own logic. But I don’t know where to start deciding.”
This time, for such people, I will write my own method for constructing logic.
What I find easy to tackle is to first decide the trigger for entry and then gradually add the required conditions.
The reason is simple: if you start with too many conditions, you’ll easily lose track of what’s good and what’s bad.
First try with one condition. Look at the results, identify the situations you’re weak in, and then think of conditions to avoid those situations.
With this order, you can build the logic while confirming each step.
Of course, this isn’t the only right answer. In the latter part, I’ll touch on another way of thinking as well.
What are triggers and filters?
It’s a bit of a tricky term, but the roles are simple.
Trigger is the signal to enter, the trigger for “I’ll enter here!”
Filter is the condition to pass on, like “but in this case, let’s skip.”
For example, suppose you buy when the price touches the lower side of the Bollinger Bands.
This “buy when touched on the lower side” is the trigger.
However, when the downward momentum is strong, even if you buy, the price might continue to fall.
So you add a condition like “do not buy when the downward momentum is strong.” That is the filter.
In other words, the trigger creates the entry cue, and the filter decides whether to take that entry.
By the way, MA is not strictly a filter and RSI is not strictly a trigger. The same indicator can serve either role depending on how you use it.
First, try with just the trigger
If it were me, I’d start as simply as possible.
“Enter when touched by Bollinger Bands”
“Enter when the MA crosses”
Start by selecting one interesting condition like this.
Then set take-profit and stop-loss rules and begin verification.
At this stage, you don’t need to force in more conditions. What you first want to know is what characteristics exist in that entry method.
Is the overall result profitable? In which situations do you tend to lose? Do profits and losses skew toward a particular period?
The initial results become the starting point for subsequent logic building.
What to beware of here is that performance isn’t determined by the entry method alone.
Even if you enter at the same place, changing take-profit and stop-loss levels will change the results. Spreads and fees also have an impact.
Therefore, you should evaluate entry method quality including settlement rules and trading costs.
If you identify how you tend to lose, think about filters
After testing, suppose you find features like this.
“Not bad in ranging markets, but I’m losing heavily on trades bought during a strong downtrend.”
In that case, the next thing to consider is “can I avoid buying during strong downtrends?”
Here you’ll try a filter to skip those scenarios.
The important thing is to first identify weaknesses and then devise conditions that address them.
“Somehow adding MA might help”
“RSI might help as well”
That kind of thinking is worth trying. But you’ll want to verify with numbers whether adding it truly improved things.
What changed before and after adding the filter
To verify, it’s easier if you don’t add multiple things at once, but test one by one.
Also, if you keep changing take-profit and stop-loss during the comparison, you may not know what actually helped. First align the settlement rules before comparing.
Does increasing win rate equal success?
When your win rate increases after adding a filter, it feels like you’ve created something good.
But win rate alone isn’t enough to judge.
Because you might be reducing losing trades while also reducing profitable trades.
So you should also look at numbers like
- Profit/Loss: whether overall profit increased
- PF: how many times more total profit is than total loss
- Maximum drawdown: how much your capital fell at its worst point
- Number of trades: enough data points to make a judgment
Which numbers you prioritize depends on the goal of your operation.
Whether you want to maximize profits or minimize capital drawdown. See whether the improvements align with that purpose.
Avoid making filters an end in themselves.
This is an important point to keep in mind.
Of course, there is also a method to consider which market to target
Up to now, I’ve described starting from a trigger.
However, there is also a method where you decide “what kind of movement do I want to capture” first.
For example, if you want to buy pullbacks in an uptrend, you would first consider the conditions for an uptrend, and among them decide when to buy. In other words, you build from the filter side.
I think this is also a natural way of thinking.
If you already have a clear movement you want to target, this may be easier for some people.
On the other hand, if you’re unsure where to begin, starting by validating a single trigger makes it easier to discover what to investigate next.
“Why is this entry method strong in certain conditions?”
“Could we reduce this type of loss by adding some condition?”
Imagine looking at the results and planning the next move.
If you find a good setting, try it on another period as well
As you adjust conditions, you may find settings that improve past results.
So you might want to finish quickly, but there’s one more thing to check.
When thinking about that setting, test it on periods you haven’t used yet.
If you repeatedly adjust while watching results for the same period, you may end up with a setting that only suits that period.
Do similar characteristics appear in other periods? Will performance suddenly deteriorate?
Future results aren’t guaranteed, but by repeating checks you increase the material you have to choose from.
What I think is important is not the number of conditions, but being able to explain why you added each condition yourself.
Try one thing first. Look at the results. Investigate what you’re curious about, and try again.
There’s no need to aim for a complex logic from the start. From such accumulations, you can build a logic you can be satisfied with.