Diablo

 

I propose a universal order placing scheme using Rabbit levels. Script for automatic placing of orders according to this scheme:

// Diablo v16.09.10
#property copyright "Jon Katana"
#property show_inputs
extern double Up=0;
extern double Down=0;
extern int Levels=0;
extern int Step=0;
extern double Vol=0;
extern int Spread=0;
int start()
{for(int i=0;i<Levels;i++)
{OrderSend(Symbol(),OP_BUYSTOP,Vol,Up+(2*i*Step+Spread)*Point,0,0,0,0,0);
OrderSend(Symbol(),OP_SELLSTOP,Vol,Down-2*i*Step*Point,0,0,0,0,0);
OrderSend(Symbol(),OP_SELLLIMIT,Vol,Up+(2*i+1)*Step*Point,0,0,0,0,0);
OrderSend(Symbol(),OP_BUYLIMIT,Vol,Down-((2*i+1)*Step-Spread)*Point,0,0,0,0,0);
OrderSend(Symbol(),OP_BUYSTOP,Vol,Up+(2*i*Step+Spread)*Point,0,Up+(2*i-1)*Step*Point,Up+(2*i+2)*Step*Point,0,0);
OrderSend(Symbol(),OP_SELLLIMIT,Vol,Up+(2*i+2)*Step*Point,0,Up+((2*i+3)*Step+Spread)*Point,Up+((2*i+1)*Step+Spread)*Point,0,0);
OrderSend(Symbol(),OP_SELLSTOP,Vol,Down-2*i*Step*Point,0,Down-((2*i-1)*Step-Spread)*Point,Down-((2*i+2)*Step+Spread)*Point,0,0);
OrderSend(Symbol(),OP_BUYLIMIT,Vol,Down-((2*i+2)*Step-Spread)*Point,0,Down-(2*i+3)*Step*Point,Down-(2*i+1)*Step*Point,0,0);}
OrderSend(Symbol(),OP_SELLLIMIT,Vol,Up,0,Up+(Step+Spread)*Point,Down-(Step-Spread)*Point,0,0);
OrderSend(Symbol(),OP_BUYLIMIT,Vol,Down+Spread*Point,0,Down-Step*Point,Up+Step*Point,0,0);
return(0);}
Variables:

Up - value of the Rabbit level closest to the price (for example, 1.3040);

Down - value of the Rabbit level nearest to the price (for example, 1.3000);

Levels - number of Rabbit levels, on which the orders of one type will be exposed (for example 5 - 10 levels up and down from the price will be involved);

Step - step between Rabbit levels in points (for example 40);

Vol - volume of one order (for example 0.01);

Spread - spread (for example 2).

Diablo at any trajectory of the price movement for a day closes either in profit (from one to several corridors between levels Rabbit), or in zero (minus spreads). Minus closing happens only at strong (more than one corridor) rollbacks from the levels of direct free orders (Buy Stop or Sell Stop), starting from the fifth level of Rabbit, counting from the price. A strong pullback from the fifth level brings losses in one corridor, from the seventh level - two, and so on. Other trajectories bring profit (one to tens of corridors) or zero. In Diablo a part of orders are closed by Take Profit or Stop Loss, while another part has no stops, forming mutual locks, which need to be closed manually at the end of the day or the next morning. The price should not go beyond the grid of orders, so the number of levels must be taken with a reserve.

The scheme consists of four parts:

1) Starting from the nearest to the price level of Rabbit, direct free orders on levels of the indicator are put in such order: Buy Stop - Sell Limit - Buy Stop - Sell Limit... And so on. The same in the other direction: Sell Stop - Buy Limit - Sell Stop - Buy Limit... These orders have neither Stop Loss, nor Take Profit, they must be closed manually at the end of the day.

2) On the same positions of the direct free orders (Buy Stop and Sell Stop) the orders of the same type are placed, but with Take Profit equal to 2xStep and Stop Loss = Step. That is, in the same place where there is a free Buy Stop, the second Buy Stop is placed, but with stops.

3) On all the same positions of direct orders inverted orders (Sell Limit and Buy Limit) with Take Profit and Stop Loss equal to Step are placed.

4) Only on the first levels nearest to the price Rabbit are placed inverted orders Sell Limit and Buy Limit with Take Profit = 2xStep and Stop Loss = Step.

 
 
Hello
 

Is that... you have to make virtual levels and write a simulation with all the possible transitions? I mean, it might be somewhat fascinating - but only because you can't calculate the behaviour of such a system.

JohKatana:
Hi
Bonjour
 

Bravo!

Good to see and read a new 'charged' topic!

 
JohKatana:
Hello
And goodbye.
 
KU!!! :)
 
granit77:
And goodbye.

Why is that?
 
sever30:
Why is that?
 
The one on the right is more attractive. :)
 
Swetten:
The one on the right is more attractive. :)
He's younger, too. I mean, he was...
Reason: