Hello dear readers. Today we will check the performance of one of the many classical systems of trade. Those who read the classic books for that, I mean, I know as a rule. The trend is necessary to trade on the direction trendovyh indicators (eg, sliding average) and flete help ostsilljatorov.
14.1 Algorithm
In fact only one definition of a trend for more of a serious issue. And the trend will help define the indicator ADX, I think, would not object because trendsledjashchy indicator. If the ADX is growing, and became the most recent N values ��of the position will be opened in order sliding average. If this trend is not present, that we have low ADX values ��will look at the value ostsilljatora. If ostsilljator in the extreme zone we open the corresponding position (otskok in the zone). The quality ostsilljatora we shall use Stochastic indicator, then it will be possible to replace or add another one.
Closing the position will be performed at the end of orders, and the state. A condition, the disappearance of this trend, the trend in open positions and achieving the opposite extreme Stochastic area for open positions in flete.
The external variables that are set out periods ADX, Stochastic, and average; zones Stochastic opening position.
14.2 Expert
/ * [[
Name: = Trend-flet
Link: = fxtest.ru
Many: = 1.00
Stop Loss: = 0
Take Profit: = 0
Trailing Stop: = 0
]] * /
define: Perma (21), PerADX (14), StochK (5), StochD (3), Stochslow (3), UpZone (75), DownZone (25), WindowADX (35), ADXmax (20), ADXmin (15 ), MApips (4);
var: Stoch1 (0), Stoch2 (0), ADX1 (0), ADX2 (0), Ma1 (0), Ma3 (0), CNT (0), f (0), TR (0);
/ *
Perma-time PhD
PerADX period ADX
StochK, StochD, Stochslow-periods stohastika
UpZone (75), DownZone stohastika WindowADX (35) of the window compared ADX
ADXmax ADX value of which is considered (25) extreme zones
it is a trend
ADXmin ADX value of which believes it flet
Dr. MApips-affinity
* /
If curtime-LastTradeTime <5 * 3600 then exit; / / ia EIA Aiea II A aiaie?
Ma1 = IMA (Perma, mode_sma, 1); / / IA
Ma3 = IMA (Perma, mode_sma, 3);
Stoch1 = this text (StochK, StochD, Stochslow, MODE_SMA, MODE_MAIN, 1); / / Stohastik
Stoch2 = this text (StochK, StochD, Stochslow, MODE_SMA, MODE_MAIN, 2);
ADX1 = iADX (PerADX, MODE_MAIN, 1); / / ADX
ADX2 = iADX (PerADX, MODE_MAIN, 2);
If TotalTrades = 0, then tr = 0;
/ * Tr define a trend if it is equal to 1 that the transaction is open as
trendovaja 2 fletovaja, the 0-transaction is not present * /
If TotalTrades <1, then
{
f = 0 / / oeaa ADX
for CNT = 1 WindowADX {if ADX1
if f = 0 and ADX1> ADXmax then
{/ / If it's more ADX
If ma1-ma3> MApips * point then
{Tr = 1;
SetOrder (op_buy, very, ask, 3, draft-stoploss * Point,
+ * takeprofit service point, green);
exit;
};
If ma1-ma3 <-MApips * point then
{Tr = 1;
SetOrder (op_sell, very tender, 3, Ask + * stoploss point
Ask-takeprofit * point, red);
exit;
};
/ / O? Aiaiaua naaeee
};
If ADX1
If Stoch1
Stoch2 then
{Tr = 2;
SetOrder (op_buy, very, ask, 3, draft-stoploss * Point,
+ * takeprofit service point, green);
exit;
};
If Stoch1> UpZone and Stoch1> Stoch2 then
{Tr = 2;
SetOrder (op_sell, very tender, 3, Ask + * stoploss point
Ask-takeprofit * point, red);
exit;
};
/ / Fletovye transactions
};
};
If TotalTrades> 0, then
{
for CNT = 1 TotalTrades
{
If OrderValue (CNT, VAL_TYPE) <= OP_SELL and
OrderValue (CNT, VAL_SYMBOL) = Symbol then
{
If OrderValue (CNT, VAL_TYPE) = OP_BUY then
{
if (adx1 UpZone), then
{
/ * The conditions of detention and trendovoj fletovoj longovoj
transactions * /
CloseOrder (OrderValue (CNT, VAL_TICKET),
OrderValue (CNT, VAL_LOTS), bid, 3, Violet);
Exit;
};
};
If OrderValue (CNT, VAL_TYPE) = OP_SELL then
{If (adx1
14.3 Conclusion
Probably, many will tell you that the algorithm is not as universal and that is clearly unprofitable, but the expert and does not address the role of the working expert. The methodical party, not as an expert and idle time and I am confident that readers who want to study languages ��in perfection, something is needed it is emphasized.
As I usually wait for your letters if questions will be very or will be particularly interesting, will meet in the next release.
Subscribe to:
Post Comments (Atom)



0 comments:
Post a Comment