TradeSignal
Library for an Expert Advisor. It generates a trade signal.
The function works conservatively, but it works well with trend reversals.
Disadvantage: shows a rapid trend reversal with a delay. Usually prohibits trading for a while.
Advantage: does not give false signals during a sluggish trend.
The function returns:
- 0 = Flat
- 1 = Buy
- -1 = Sell
Function parameters:
- TF - timeframe in minutes
- Period_1 - the number of periods for indicator 1
- Period_2 - the number of periods for indicator 2
- Differ_1 - the value with which the data given by the indicator 1 are compared
- Differ_2 - the value with which the data given by the indicator 2 are compared
- ShowTrendLines - enable/disable displaying the trend lines on the chart
importing the function from the library
#import "signal.ex4" int t_Signal(int tf=1,int perBig=0,int perLittl=0,int difBig=0,int difLittl=0,bool draw=true); #import
Example of use in Expert Advisors
input int TF =60; input int Period_1 =150; input int Period_2 =60; input int Differ_1 =4; input int Differ_2 =20; sinput bool ShowTrendLines =true; bool UP=false, DN=false; // --------------------------------------- void OnTick() { int signal=t_Signal(TF,Period_1,Period_2,Differ_1,Differ_2,ShowTrendLines); UP=false; DN=false; if(signal == 1) UP=true; if(signal == -1) DN=true; } //-- onTick()
The example shows the recommended settings for GBPUSD.
Not the easiest pair, so the basic setup of the code (calculation parameters) was performed on it.
I recommend working with virtual or usual stop orders with a distance to the opening level equal to 65 points. (4 Digits).
It is useful to move the order after the price in steps of 15pt.
The function gives a steady signal. The orders are generally moved by trailing. For this reason, you do not need to reduce the distance. This will significantly increase the risk of a loss.
状态:离线 发送信件 在线交谈
姓名:顺水的鱼(先生)
职位:投机客
电话:18391752892
手机:18391752892
地区:默认地区
地址:西安市高新区软件园
邮件:3313198376@qq.com
QQ:3313198376
微信:18391752892
阿里旺旺:顺水的鱼waterfish
Skype:3313198376@qq.com

