Pages

Subscribe:

Thursday, May 26, 2011

period CCI, RSI, RSI levels

Hello dear readers. Today we will write expert algorithm that sent me Alexei Prokofew. Here are quotes from his letters.

"... The best tool for trading the currency pair EUR / USD in the day - trading system oscillator + CCI positions in this system of open ostsilljatorom crossing zero line (for a 4-hour and hour schedule) as signal of the closure .. position marks the return passage ostsilljatorom 100 (long positions) or signs-100 (short positions) and serve.

This expert on the pages of the magazine would like to look at the ... "

I asked about what ostsilljatore a speech.

The answer to the question.
"... RSI, crossing the line averaged -. Opening Closing values ��respectively 70 and 30 ..."

Well, we'll try it all to formalize.
16.1 Algorithm

I mean, it's important to write some experts.
The first expert will work only on CCI.
The entry will be long done by crossing the zero line from the bottom up. Output transition from top to bottom the values ��100th

Entering the blinkers will be made by crossing the zero line from top to bottom. Output transition from bottom-up value -100.

All intersections is taken into account in the last bar, we enter the opening of the new bar.

The second expert will add RSI. I think that open and close positions of passage RSI 70 and 30 special senses was not present, and the letter is not clear how to coordinate the two indicators. Therefore, I propose to make RSI filter and enable them to enter the market signals of CCI values ��RSI. That entry in the long RSI should be at least less than 50, the entry in blinkers at least it is more than the 50th The boundaries of "correct" values ��to be set in outer variables.
16.2 Expert


/ * [[
Name: = CCI
Author: = forextimes.ru
Link: = www.fxtest.ru
Many: = 1.00
Stop Loss: = 100
Take Profit: 200 =
Trailing Stop: = 0
]] * /
Define: by (14);
var: CNT (0), cci1 (0), cci2 (0);

If CurTime-LastTradeTime <8 * 3600 then exit; / / restriction
/ / The amount of opening frequency of transactions (for I4 2 time)

cci1 = icci (by, 1); / / CCI value
cci2 = icci (after, 2);

If TotalTrades = 0, then
{
If FreeMargin <1000 then exit;

If cci2 <0 and cci1> 0 and cci1 <100 then
{
SetOrder (op_buy, very, ask, 3, draft-stoploss * Point,
+ * takeprofit service point, blue);
exit;
};

If cci2> 0 and cci1 <0 and cci1> -100 then
{
SetOrder (op_sell, very tender, 3, Ask + * stoploss point
Ask-takeprofit * point, red);
exit;
};
};

/ * Conditions of entry, are included additional terms cci1 <100
cci1> -100, that a condition for opening will not coincide with state
a close * /

If TotalTrades> 0, then
(/ / Open positions are not present
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 / / is open long
{
/ / If cci2> 100 cci1 <100 then
If cci2> 100 cci2> cci1 then / / condition for closure
{
CloseOrder (OrderValue (CNT, VAL_TICKET),
OrderValue (CNT, VAL_LOTS), bid, 3, Violet);
Exit;
};
};
If OrderValue (CNT, VAL_TYPE) = OP_SELL then / / it is open blinkers
{/ / If cci2 <-100 and cci1> -100 then if cci2 <-100 and cci2 <cci1 then / / condition for closure
{
CloseOrder (OrderValue (CNT, VAL_TICKET),
OrderValue (CNT, VAL_LOTS), to ask, 3, Violet);
Exit;
};
};
};
};
};

The second expert, an additional requirement RSI.
/ * [[
Name: = CCI2
Author: = forextimes.ru
Link: = www.fxtest.ru
Many: = 1.00
Stop Loss: = 100
Take Profit: 200 =
Trailing Stop: = 0
]] * /
Define: perCCI (14), perRSI (14), RSIUp (60), RSIDown (40); / / period CCI, RSI, RSI levels
var: CNT (0), cci1 (0), cci2 (0), rsi1 (0);

If CurTime-LastTradeTime <8 * 3600 then exit;

cci1 = icci (perCCI, 1);
cci2 = icci (perCCI, 2);
rsi1 = irsi (perRSI, 1);

If TotalTrades = 0, then
{
If FreeMargin <1000 then exit;

If cci2 <0 and cci1> 0 and cci1 <100 rsi1 <RSIDown then
{SetOrder (op_buy, very, ask, 3, draft-stoploss * Point,
+ * takeprofit service point, blue);
exit;
};
If cci2> 0 and cci1 <0 and cci1> -100 and rsi1> RSIUp then
{SetOrder (op_sell, very tender, 3, Ask + * stoploss point
Ask-takeprofit * point, red);
exit;
};

};
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 cci2> 100 cci1 <100 then
{/ / If cci2> 100 cci2> cci1 then
{
CloseOrder (OrderValue (CNT, VAL_TICKET),
OrderValue (CNT, VAL_LOTS), bid, 3, Violet);
Exit;
};
};
If OrderValue (CNT, VAL_TYPE) = OP_SELL then
{
If cci2 <-100 and cci1> -100 then
{/ / If cci2 <-100 and cci2 <cci1 then {
CloseOrder (OrderValue (CNT, VAL_TICKET),
OrderValue (CNT, VAL_LOTS), to ask, 3, Violet);
Exit;
};
};
};
};
};
16.3 Conclusion

The first expert (without filter RSI), testing on historical data EUR / USD I4 showed unsatisfactory results. Because trade is undoubtedly convenient.

The second expert for the same historical data showed the best results for 3 years 261 point on 15 transactions, item 221 maximum drodauna. The truth of the "softer" values ��of the RSI levels of transaction volume increases, but the result does not appear satisfactory.

Probably not until the end have correctly understood the expert algorithm, because it is the next release system will be modernized.

0 comments:

Post a Comment