Main strategy

The main trading strategy triggers a trade at the change of the hour when a new high or low is made.
In live trading and in visual backtests a blue line marks the Buy trigger line, the red line shows the Sell trigger line. Every line in the chart shows its meaning by mouseover in a small popup window. The left window shows the mouseover data of the red line: BarsSell is the number of bars set in BarsSell. The first value, here 1.1916 is the true value of the line. The second value metatrader shows automaticly, its not correct, ignore it.
A comment shows what hour it is for the EA according to its SetUTC setting. Then follows the value of our own volatility parameter xl. xl is the average High-Low of the last 24 candles (hours).

Then follows the value of our own parameter RelDistMA. Read more about it in own parameters >> Then follows DistUp= distance in points the price must go up to reach the Buy trigger line. DistDn= distance in points the price must go down to reach the Sell trigger line. The second window shows the mouseover of the clear blue line below it. The lines in the chart mark the Highs and Lows of former days, weeks and month.

  • hhd1 is the highest high of the day before, hhd2 the high of the day before and so on
  • lld1 is the lowest low of the day before, lld2 the lowest low of the day before that day
  • hhw1 is the highest high of the week before, hhd2 the high of the week before it etc
  • llw1 is the lowest low of the week before, lld2 the lowest low of the week before etc
  • hhm1 is the highest high of the month before, hhm2 the high of the month before it etc
  • llm1 is the lowest low of the month before, llm2 the lowest low of the month before etc

Preview function

The picture below shows a moment where the price has gone over the Buy trigger line. The orange text ‘NextSell’ shows the preview that a filter will change the basic strategy and trigger here a Sell instead of a Buy.

The yellow ‘ok hook’ shows by mouseover that filter B4 will trigger the sell. Its code includes + hr!=17 what means the filter is not active at 17 o’clock. The comment shows that it is 17:25 so the filter shouldn’t be active. But its a preview for 18 h, the preview function takes
that into account.

The other conditions of this filter are fulfilled no matter where the candle closes in 35 minutes. So its clear that a Sell will be triggered. Some other filters are not that clear. If in a filter e.g. is a condition that the candle closes over a line and the price fluctuates, is once over, once under the line it maybe open until the last second if a Buy or Sell is triggered. For that reason the texts ‘NextSell’ or ‘NextBuy’ are deleted always after 5 minutes and must be confirmed again. In some cases it may happen that no clear statement comes, once it shows ‘NextSell’ then ‘NextBuy’. In the last 5 minutes before a new candle starts the texts are not deleted anymore and every minute can appear a new one if its different than the one before. If the price fluctuates and the decision is not clear one should leave the decision to the EA, only experienced trader should intervene here.

Volatility xx and xl

To get a value of the current width of fluctuation of the market we have a short and a medium term parameter. In our parameters we have already x = high – low of a candle. Now we add the x of the last 10 candles and divide it by 10, that’s called xx – the average high – low of the last 10 candles. xl is the same but for the last 24 candles. The value for xl is shown in live trading and visual backtesting in the comment and in the chart by mouseover on arrows.

The mousetip on an arrow that marks a trade shows here 201 for xl. The minus 3 relates to the moving averages below.

Two Moving Averages

After a backtest two moving averages can be seen. They have the same parameter settings but one is shifted 2 bars behind the other. The steeper the rise or fall of the moving averages the bigger the distance between both. We substract the value of the shifted moving average (ma) from the non shifted, that value is multiplicated with 10000 to get a value in points, dma= distance moving averages. In the picture above dma=-3.
So the distance between both lines is 3 points, the lines are falling. A high value of dma
like e.g. 100 indicates a strongly rising market, -100 a strongly falling. In some filters dma is used.

Distance to a moving average

Another parameter of Active Trader is the relative distance of the current price to the not shifted moving average (ma). If you study the charts you see that sooner or later the price returns to its ma. Active Trader uses as filter the setting MaxDevMa (Maximum Deviation ma) that relies on that. The filter doesn’t work directly with the deviation of the price from the ma, it works with a relative value. It puts the deviation in relation to the volatility indicator xl. In a market with high volatility the price can deviate more from the ma than with low volatility.

If the relative deviation MaxDevMa is reached it is marked in the chart with arrows in magenta.

Live trading features >>