[ARCHIVE!] Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Can't go anywhere without you - 4. - page 172

 
Divide the price by the digits = reduce it to an integer and write it in a medjic, then search the array of open orders for the medjic before setting a new order.
 
bestfx:
Hello all. Please help.

The essence is the following: There is a bot that automatically places pending orders, at a certain price. ...
double main_price=1.251;
double price_to_byu=1.253;
double price_to_sell=1.249;
// --------
bool restriction=false;
if (Ask<=main_price)
if (OrdersTotal()>0)
{  for (int i=OrdersTotal()-1; i>=0; i--)
   {  if (OrderSelect(i,SELECT_BY_POS,MODE_TRADES))
      if (OrderSymbol()!=Symbol()) continue;
      if (OrderType()==OP_BUY || OrderType()==OP_BUYSTOP)
      {  if (OrderOpenPrice()==price_to_byu) restriction=true;
}  }  }
if (restriction==false)
{  OrderSend(NULL,OP_BUYSTOP,Lot,price_to_byu, ...);
   return(0);
}
// --------
restriction=false;
if (Bid>=main_price)
if (OrdersTotal()>0)
{  for (int i=OrdersTotal()-1; i>=0; i--)
   {  if (OrderSelect(i,SELECT_BY_POS,MODE_TRADES))
      if (OrderSymbol()!=Symbol()) continue;
      if (OrderType()==OP_SELL || OrderType()==OP_SELLSTOP)
      {  if (OrderOpenPrice()==price_to_sell) restriction=true;
}  }  }
if (restriction==false)
{  OrderSend(NULL,OP_SELLSTOP,Lot,price_to_sell, ...);
   return(0);
}

If you are placing a lot of similar orders, you need to use arrays. How? Read about arrays.

 
Lisi4ka330:
as of 1 June, versions younger than 416 build
are not supported.

Natasha, are they no longer supported by your computer? )

Put 409 in parallel to your main terminal, in a nearby folder, dump all the history you need there and test as much as you can, you don't need a connection to the server for that. If you used birt's scripts, you're probably offline anyway.

 
FAQ:
Divide the price by the digits = reduce it to an integer and write it in a medjic, then search the array of open orders for the medjic before setting a new order.

It just doesn't make any sense.
 
paladin80:
If you are placing a lot of similar orders, you need to use arrays. How? Read about arrays.

I've been reading for the third day now. :=( It's easier in php, but I don't understand it here.
 
Lisi4ka330 09.06.2012 20:33
Yes, tried it but nothing worked((((

Then it can be done in a different way.

It will work in both MT4 and MT5.

1. Download all ticks (you know where from) and write them to the server like MS SQL server, because the volume of data is huge.

2. Write a DLL for MT4 and MT5 to cooperate with the SQL server.

In MT4 you check the flag IsTesting ( ) and if it is testing, instead of quotes values you substitute data from the database (the price inverse time) and that's all, nothing complicated.

P.S. This variant is better as it will work for any builds and on both MTs than the one you used with the modification of the program's machine code.

 
bestfx:

:=( This is some bullshit.


In your case, you need to check before opening if there are any orders already set with this price. If you want to compare prices, you have to remember about normalization and also about slippage.

In this case, the standard comparison of two integers will be applied (quick).


If you place a great many similar orders, we should use arrays. How? Read about arrays.


OrdersTotal() and OrdersHistoryTotal() are both arrays.

 
pusheax:

Then it can be done in a different way.

It will work in both MT4 and MT5.

1. Download all ticks (you know where from) and write them on a server like MS SQL server, because the volume of data is huge.

2. Write a DLL for MT4 and MT5 to cooperate with the SQL server.

When MT4 checks the IsTesting( ) flag and, if it is testing, instead of quotation values you substitute data from the database (the price inverse time).

P.S. This variant is better, because it will work for any build and on both MTs, than the one you used with modification of the program's machine code.

It won't work because the transaction will not be done using quotes from the database, it will say that the price is incorrect. It is easier then to write your own tester.

Don't confuse the girl, I just tested the EA on the 409 build with the old script, everything works great.

 
alsu:

It won't work, because you can't make a deal based on quotes from the database, it will say that the price is wrong. It would be easier to write your own tester.

Do not confuse the girl, I have just tested the Expert Advisor on 409 build with an old script, everything is working fine.


Well, I understood it later. I've tried to create something similar, but I've never managed to build ticks, but they are ready now.

I can't really do it without modifying the machine code.

I wrote this idea so as to discuss, not confuse, as I really liked the idea and will do it myself.

 
pusheax:

Well, I figured that out later on. It's just that I myself tried to do something similar before, but could not assemble the ticks, and here they are ready.

Indeed, without modification of the machine code it seems that it will not work.

I've written this idea to discuss, but not to confuse, because I liked the idea and will do it myself.

If you do not know what to do with it, you may be right, I'll start fixing it (for example, if you do not know what to do with it))).

ps and also with real ticks, blackjack and whores

Reason: