This Expert Advisor/indicator calculates past bars for the corresponding price patterns and calculates the probability of price movement up and down. The algorithm can calculate bars in chains of up to 5 pieces, can work with any financial instrument. It classifies the price behavior into 8 groups with configurable thresholds.
The Expert Advisor can display signals with arrows, can issue alerts about the possibility of buying/selling, or do all the work for you and trade automatically. For your convenience, it displays the relevant information on the screen. The upper right corner shows the past and current price action in groups with user-defined threshold values (for example, B5: -200/-100 means that the price dropped from 10 to 20 pips on the fifth past bar). B0 is the current bar. If you are tracking signals on the screen, then you should sell when the down arrow appears and buy when the up arrow appears.
The patterns and probability forecast are shown in the lower right corner. The first two lines are the number of patterns counted for this group. Pu and Pd are the predicted probability of price movement up and down.
Suppose the following values are shown in the corner:
- B5: 0/100 — the fifth past bar increased by 0-10 pips.
- B4: -100/0 – the last fourth bar decreased by 0-10 pips.
- B3: 0/100 — the third past bar increased by 0-10 pips.
- B2: 0/100 — the second past bar increased by 0-10 pips.
- B1: -100/0 — the first past bar decreased by 0-10 pips.
- B0: 0/100 — the current bar increases by 0-10.
[spoiler title=”Read More…”]
Let’s say the thresholds of the price movement are as follows: -300/-200/-100/0/100/200/300.
U//D=T: 6/3/41/378//351/26/4/5=814 (with the current price pattern B5-B1, at the last bars of the pattern immediately after, 6 bars increased (Up) in more than 30 pips, 3 increased by 20-30 pips, 41 bar increased by 10-20 pips, 378 bars increased by 0(//)-10 pips, 351 bar decreased (Down) to 0(//)-10 pips 26 bars decreased by 10-20 pips, 4 bars decreased by 20-30 pips, and 5 bars decreased by more than 30 pips, with a total number of bars Total 814, along with the current price pattern).
- U//D=T: 428//386=814 – similar to the previous one, but counts only the movements up U ps and down D owns.
- Pu: 0.52580 – probability of price increase.
- Pd: 0.47420 — probability of price decrease.
- Bars: 50000 — the number of calculated bars for the price model.
show_signal – set to true to display buy/sell signals with up/down arrows.
alert_signal — set to true to enable alarm alerts.
number_of_past_bars – it is necessary to set a sufficiently large value on which the adviser will search for patterns.
number_of_chains — a value from 1 to 5, on which patterns are formed at the latest prices.
buy_probability (sell_probability) — probability threshold for a buy (sell) signal.
sufficient_pattern_count – specify a positive number so that when the total number of price patterns on the past bars is exceeded, the EA sends a signal.
PriceAction_Thresholds — levels for classifying price movement. If the error “Markovchain Bin Thresholds are not acceptable” is returned, then it is necessary to check the order of the threshold values (Threshold 1
auto_trade – set to true, and the Expert Advisor will trade automatically on the selected signals. The value true changes the values of the show_signal and alert_signal parameters to false.
lot_size — the lot size used for automatic trading.
magic_number – ID for automatically completed transactions.
price_slippage — the maximum allowed slippage during the opening and closing of trades.
ea_comment – comment for transactions made by the Expert Advisor.
show_signal – set to true to display buy/sell signals with up/down arrows.
alert_signal — set to true to enable alarm alerts.
number_of_past_bars – it is necessary to set a sufficiently large value on which the adviser will search for patterns.
number_of_chains — a value from 1 to 5, on which patterns are formed at the latest prices.
buy_probability (sell_probability) — probability threshold for a buy (sell) signal.
sufficient_pattern_count – specify a positive number so that when the total number of price patterns on the past bars is exceeded, the EA sends a signal.
PriceAction_Thresholds — levels for classifying price movement. If the error “Markovchain Bin Thresholds are not acceptable” is returned, then it is necessary to check the order of the threshold values (Threshold 1 auto_trade – set to true, and the Expert Advisor will trade automatically on the selected signals. The value true changes the values of the show_signal and alert_signal parameters to false. lot_size — the lot size used for automatic trading. magic_number – ID for automatically completed transactions. price_slippage — the maximum allowed slippage during the opening and closing of trades. ea_comment – comment for transactions made by the Expert Advisor. A demo version is also available [/spoiler]