Discussion of article "Learn how to design different Moving Average systems"

 

New article Learn how to design different Moving Average systems has been published:

Short description: at this article, we learn how to design different Moving Average systems according to different Moving Average strategies.

In this article, we will choose Simple Moving Average. However, you can use any desired Moving Average type in your code.

According to the strategy, prices and SMA will be checked at every tick:

  • Price > SMA: signal will be to buy, and we need this signal to be appear as a comment on the chart.
  • Price < SMA: signal will be to sell, and we need this signal to be appear as a comment on the chart.
  • If anything else, do nothing.

The following screenshot shows One Simple Moving Average Blueprint that we want to design:

1MA Blueprint


Author: Mohamed Abdelmaaboud

 
On one hand thank you for making this beginner series. On the other hand I am surprised that you haven't got any comments about why you are not supposed to initialise indicator handles inside OnTick yet.
 
Very easy to comprehend reasoning. I was at first worrying about some possible jitter around the point of crossover; some risk of the position moving back and forth between a buy/sell signal resulting in lots of short-lived loss trades. That some margin would be needed in the calculation for a hysteresis effect. But margins also affects reponsiveness. But I see different prices are used in the buy/sell cases (ask/bid) and this makes for some margin.
The Strategy Tester will be useful. By parameterizing uncertain behavior the Strategy tester can reveal unexpected findings that help improve on a strategy.
Reason: