Discussion of article "MQL5 Cookbook - Trading signals of moving channels"
Thanks for the article! In your video you build the channels as two segments. Why don't you do the following
- on each current bar (the rightmost one) remember the upper boundary and the lower boundary, falling at the time of this bar.
- Now we build two lines for all bars - the corresponding upper and lower values.
- Now we have a channel, which is very convenient to evaluate visually.
Avg = (Channel.High + Channel.Low) / 2; Size = (Channel.High - Channel.Low) / 2; NewSize = Size * InputKoef + InputDelta; NewChannel.High = Avg + NewSize; NewChannel.Low = Avg - NewSize;
What do you think should be added/optimised/removed in order to start using it on a live account. Or is this purely a demo version?
On the code. Usually I loop a trading operation for a real account, i.e. I make several attempts to reduce the probability of not opening a position when a signal comes. And there are some other small checks.....
On the strategy itself. You need a deeper history on which backtesting is done. Especially good when there are different sections (trend/flat). And classically, forward testing is missing....
...the video plots the channels as two segments. Why don't you do the following
- on each current bar (the rightmost one) memorise the upper boundary and the lower boundary, falling at the time of this bar.
- Now for all bars we build two lines - the corresponding upper and lower values.
- Now we have a channel, which is very convenient to evaluate visually.
What's the point?
To see the channel throughout history.
So that past channels do not disappear when a new one appears?
To see on the history, where the pending orders would be placed on the edges of the channel, in case of trading it.
- votes: 18
- 2011.11.29
- Nikolay Kositsin
- www.mql5.com
New article MQL5 Cookbook - Trading signals of moving channels has been published:
The article describes the process of developing and implementing a class for sending signals based on the moving channels. Each of the signal version is followed by a trading strategy with testing results. Classes of the Standard Library are used for creating derived classes.
So, let us start with something simple that can be improved and revised with the help of the OOP. Let there be some basic strategy.
This strategy will consider fairly simple trading rules. Market entries will be made by the channel borders. When the price touches the lower border a buy position will be opened, when it touches the lower border - a sell position. Fig. 1 shows that the price touched the lower border, so the robot bought a certain volume. The trade levels (stop loss and take profit) have a fixed size and were placed automatically. If there is position opened, the repeated entry signals will be ignored.
Fig.1 Entry signal
Author: Dennis Kirichenko