Pages

Subscribe:

Thursday, May 26, 2011

basic probojnuju system.

Hello dear readers! Today we will write a basic probojnuju system.
12.1. Algorithm

Probably many of you know, that such probojnye systems. The market has moments when it is possible to assume with great probability, that the price will drastically go up or down. For example, when ranok pred out of serious news. All players are waiting and one outlet open in the required side. But as most readers of these lines is received the news late, there is no sense of place of suspended arrest warrants probitie the current levels of consolidation.
Expert analysis and maximum floor prices (shadow svechej) for a certain period (we can adjust the period) and delayed orders for the arrest of the two sides of the current price is exposed. It will be the warrants of the type A <op_sellstop>. For greater efficiency would expose orders only if the difference between the maximum and a floor price for a period of not more than size determined by us, (this size defines the width of the channel, the news many have been waiting, therefore, the channel is narrow).
We summarize the algorithm. If it is present and exposed positions otrytyh warrants. We believe that the maximum a floor price for this period, calculate the difference between them. If the difference is less than the threshold we have established that we expose two warrants for failure. Orders that are exposed to a small park, for example, 5 items, however, will make this custom size too because of different time frames of action will be different. After work one of the warrants, the second order leaves.
12.2. Expert

/ * [[
Name: = Proboy
Author: = fxtest.ru
Link: = forextimes.ru
Many: = 1.00
Stop Loss: = 20
Take Profit: = 40
Trailing Stop: = 0
]] * /

Define: HL (85), N (9), Zapas (5);
/ *
HL-difference between the extreme prices,
N-period, Zapas-exposure to the stock suspension order * /

var: S (0), b (0), ho (0), here (0) I (0), fl (0);
/ *
S-amount delay OP_sellSTOP
b-delayed quantity OP_BUYSTOP,
i-variable cycle
Ho-a price move of the period
here-ieieiaeuiuy price period
of ET-flag representing the second order * /

/ * 10 SEK tajmaut until they passed out of the expert will be implemented * /
If ((CurTime-LastTradeTime) <11) then exit;

/ * The two warrants at the same time to put it is impossible, OP_sellSTOP placed after 10 SEK, with the flag * /
if fl = 1 then
{
fl = 0 / / zeroing of the flag and delayed exposure 2ai
SetOrder (OP_sellSTOP, very here-Zapas * item 3 here + StopLoss * Point
here-TakeProfit * Point, Red);
};

b = 0 / / zeroing of variables to account
S = 0;
If TotalTrades = 1 then exit; / * if a guarantee that it is only open, it is an order of the market, we leave * /

If totaltrades <> 0 then for i = 1 to TotalTrades
Start
IF OrderValue (i, VAL_TYPE) = OP_BUYstop then
b = b +1 / / calculate positions in the cycle
If OrderValue (i, VAL_TYPE) = OP_SELLstop then a = a +1;
if (a> b) = 2 then exit; / / if 2 delayed to leave
end;

/ * If a delay was left (it has already become redundant because one has played, we delete * /
If TotalTrades <> 0 and (a + b) = 1, then
{
for i = 1 to TotalTrades
Start
If (OrderValue (i, VAL_TYPE) = OP_sellSTOP) or
(OrderValue (i, VAL_TYPE) = OP_buySTOP), then
DeleteOrder (OrderValue (i, VAL_TICKET), blue) / / removal
end;
exit;
};

If TotalTrades = 0 and (b + S) = 0, then
{/ / Presence minimal, the price ceiling
ho = h [1];
here = L [1];
for i = n DownTo 1
Start
if h [i]> then ho ho = h [i];
if l [i]


fl = 1;
SetOrder (OP_BUYSTOP, very, ho + * Zapas point, 3, ho-StopLoss * Point
ho + TakeProfit * Point, blue); / / 1E of 2o
};


12.3. Conclusion
Since it is most simple probojnyj algorithm, it certainly does not bring a decent profit, but such systems exist in more complex variants. There is a sense to connect with expert only at certain times (before the news outlet). It is possible to include additional conditions for the length of shadows svechej period or (e) and put limits on the volume, but because of the volume forekse tikovyj, it will not give specific improvements.
I would like to burn after message to your questions. I am convinced that in the course of creating their own experts in you arise. Send all questions to me on email, I promise the next post to respond at all.

0 comments:

Post a Comment