WT String2Signal
- Индикаторы
- Ricardo Almeida Branco
- Версия: 1.0
- Активации: 5
Easily convert your candlestick patterns into signals!
Eval - Command interpreter - Command line interface - String converter - Customizable sign
I bring one more indicator that was requested by a real trader. Thanks for the suggestion mate!
The String2Signal indicator will allow you to write your candlestick patterns and get the signals on the screen, integrating with EAs or using it to assist in manual operations.
You type a text with your setup and the indicator converts it into the MQL5 language, placing buy or sell signals on the screen.
For example, giving a buy signal when the tick volume is greater than 200 and the current close is greater than the high of the previous candlestick, can be written as tv[0]>200 && C[0]>H[1], that simple!
▶ The commands accepted in the indicator are:
1) The commands obtained natively in indicators (For these commands, use only the initial capital letter):
O (Open) H (High) L (Low) C (Close) TV (Tick Volume) V (Real Volume) S (Spread)
2) Some of the commonly used mathematical functions (to understand each function click on each function):
max min abs floor ceil round sqrt mod pow
3) Operations and expressions used in the MQL5 language. They are usually mathematical operations, logical comparators of greater, lesser, among others. Here I draw attention to the logical combinations && (and), which combines two expressions where both need to happen, and || (or), which combines two expressions where only one of them needs to happen. Thus, we can use the expressions:
Or | And | Addition | Subtraction | Multiplication | Division | Rest of Division | Greater than | Less than | Greater Than Or Equal | Less Than Or Equal | Equal | Different (Is not equal) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
|| | && | + | - | * | / | % | > | < | >= | <= | == | != |
▶ Let's see some examples of what can be used:
· Rule Buy (1): C[1]>O[1] (will place a buy signal on the entire candlestick where the previous bar has a close greater than the open, i.e. it is a bullish bar).
· Rule Buy (1): C[1]>O[1] && C[2]>O[2] && C[3]>O[3] && C[4]<=O[4] && C[5]<=O[5] (will put a buy signal when we have three bull candles followed by two bear candles or doji).
· Rule Buy (1): C[1]>O[1] && H[1]-L[1]>=100 (will place a buy signal when we have a bullish candle and the amplitude (maximum – minimum) is greater than or equal to 100).
· Rule Buy (1): abs(C[1]-O[1]) >= 300 && C[1]>O[1] (will place a buy signal when the absolute value of the open price minus the close price is greater than 300 and it is a bullish candle. Here, as we don't know if the opening price was higher or lower than the closing price, we ask for the absolute value - always positive)
▶ In a similar way, we can write conditions of sale.
If you have any condition that you are unable to write, leave a message here in the comments and I'll help you write. If it is a confidential case, you can send a private message through mql5.com messages.
▶ Indicator parameters:
Look back = 1000; // The indicator will plot the arrows (when placed on the chart) analyzing the last 1000 candles. This is to save processing when the indicator needs to look at the history. After being on the chart it only looks at the most recent candles.
Calculate in new bar Only = true; // In this case the indicator only recalculates on each new candlestick. This is to save real-time processing.
▲ △ Buy Condition △ ▲
Here we have 3 text fields and 2 connectors. By limitation of MT5 each text entry has a limit of 243 characters. If your input rule is longer than 243 characters, you can combine the other two fields of each condition and combine the fields using && or ||. If you are not going to use the fields below, check the “ignore field below” box.
▲ △ Sell Condition △ ▲
A mesma coisa para as condições de venda.
▶ ▶ ▶ That's it, a practical way to get your buy and sell signals that read candles.
Take a look at my other indicators, and if in doubt, leave your message here on the indicator or send me a private message.