[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 257

 

Man, I've had a tortured night of tests already. Situation:

We write a script.

if(OrderSend(Symbol(),0,0.1,NormalizeDouble(Ask,Digits),200,NormalizeDouble(Ask-150*Point,Digits),NormalizeDouble(Ask+150*Point,Digits),NULL,0,0,CLR_NONE)<0){
  Print("Ошибка - ",GetLastError());
}

We throw it on the four digits and everything's fine. On a five-digit, the devil gives error 130. We should keep in mind that the minimum allowed distance for placing a stop order is 10 points. What's the problem?

P.S.

Here are the demo account details:

Login : 91249894
Password : xv7igki

Server: DEM15METADC11.efxnow.com

 
The issue has been resolved. It turned out that on this demoserver you cannot put stop orders together with an order setting. You can only modify. Then another question, can someone suggest me a five digit account where orders can be set along with stop orders? Please open a demo for me if you don't mind.
 
drknn:
The issue has been resolved. It turned out that on this demoserver you cannot put stop orders together with an order setting. You can only modify. Then another question, can someone suggest me a five digit account where orders can be set along with stop orders? Please open a demo for me if you don't mind.
In my opinion it is better to set an EA and modify it by setting TP and SL.
 

Can you tell me how to specify the condition for the Tester to determine the bar number of the lower timeframe within the text.

For example: The tester starts with H1, then it determines the start time of the n-th candle in the textframe, and the next step is to determine the number of the candle, which started at the same time, but by the timeframe below. iBarShift always writes 0. The block responsible for the bar calculation is below:

        ti = iBarShift(Symbol(), 0, Time[i], false); //Alert(dayi);  - возможно, что эта функция лишняя, но для тестера её решил всё таки прописать
        datetime dt = iTime( Symbol(), 0, ti);    //Alert(TimeToStr(dt,TIME_DATE|TIME_MINUTES));
        int a = iBarShift(Symbol(), PERIOD_M30, dt, false); //Alert(a); - постоянно выдаёт 0, не в тестере всё работает отлично
        
 
paladin80:
I think it would be better to write the Expert Advisor so that it would modify it setting TP and SL right after order placing.


If the server has prohibited to set an order together with a stop order, the order will not get up. If we set an order with zero stop orders, then we are wasting our time on servers where this restriction is not set, so just imagine that the EA has placed the order without any stops and then the light just went off at your home. The price reversed and ate a lot of money. It is an unpleasant situation.

I have found a way to find out programmatically whether the server allows the order to be set together with stop orders. And it would be possible to play around with it in the code. But the issue of power outage spoils everything.

 
drknn:

If the server has a ban on placing an order together with stop orders, the order will not be placed. If you set an order with zero stop orders, then on servers where this restriction does not exist, we are wasting time - just imagine - the EA has placed an order without any stops, and then your house light gets cut off. The price reversed and ate a lot of money. That is a very unpleasant situation.
I ran a check to open an order and then modify it in the same cycle. There's an uninterruptible power supply and a modem pen in case of a power failure.
 
drknn:


If the server disables setting an order together with a stop order, the order will not get up. If we set an order with zero stop orders, then on servers where there is no such restriction, we are losing time - just imagine that the EA has placed the order without any stops and then your home power is cut off. The price reversed and ate a lot of money. It is an unpleasant situation.

I have found a way to find out programmatically whether the server allows the order to be set together with stop orders. And it would be possible to play around with it in the code. But the power outage issue spoils everything.

Yeah, well, you have to find a company that allows you to install everything at once, either a VPS or an extra external battery to the computer.
 

Hello! Help me understand, I express the closing price of the previous bar as Bid[1], but the price comes in ticks, not bars (intervals).

And there is an error during compilation - '[' - unexpected token

 
skyjet:

Hello! Help me understand, I express the closing price of the previous bar as Bid[1], but the price comes in ticks, not bars (intervals).

I also got an error when compiling - '[' - unexpected token

Closing price of the previous bar Close[1]

 
skyjet:

Hello! Help me understand, I express the closing price of the previous bar as Bid[1], but the price comes in ticks, not bars (intervals).

An error appeared during compilation - '[' - unexpected token

I need Close[1]

Bid - is not an array and equals Close[0].

Reason: