Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 6. - page 704

 

Please advise what the nuances are with inserting an OBJ Bitmap label object.

1. Only BMP files are supported?

2. What should this bmp be?

For example, if I save it to JPG, then convert it to bmp using Auotator (from MAC os), then this file won't open in MT4.

 
borilunad:
Who knows or has a script or function "close with overlapped orders", which is executed manually in MT4, when you need to close more than 2-3 positions, so as in CloseBy, spread would be saved? I would be happy for any leading answer!
Here.
 
TarasBY:
Here.


Thanks!!! I'll try to figure it out so I can put a function in the owls!

Sorry, too much stuff and complicated! For now we'll have to close in stages with a double-check of what hasn't closed!

 
borilunad:


Thanks! I'll try to figure it out so I can put a function in the owls!

Sorry, too much stuff and complicated! For now we'll have to close in stages with a double-check of what hasn't closed!

Such a function:

/*int fClose_AllOrdersBy (double& fd_Pribul,       // Возвращаемый профит закрытых ордеров
                          int fi_Type = -1,        // тип закрываемых ордеров
                          int fi_NBars_Life = 0,   // минимальная "жизнь" ордера в барах на fi_Period: 0 - параметр не учитывается
                          int fi_Period = 0,       // Период
                          int fi_OrderProfit = 0)*/// Идентификатор профитности ордера: > 0 - профитный; < 0 - лоссовый
                                     // Функция закрытия "своих" ордеров по признаку встречными ордерами

here.

 
TarasBY:

Such a function:

Here.


Thank you very much, and no offence, please! I have found it, the function is more than 100 lines, and as I understood it, I also need to attach a library, so it's not for me, I can't afford it! There is no sense in making mess for 4 or, in a pinch, 6 orders! I will not do it, it is too unusual for me! I still have to deal with mine, but it is getting better and better! And with mine it's easier, like a fish in water, easier, but also with my findings! Maybe "bicycles" have already been invented, but getting there and doing it yourself, then it's easier to work with your own! Once again, please excuse me! All the best and success!
 

Hello comrades! I apologise at once for the nouveau riche question. The opening price of the order is 1.61029. I used "OrderOpenPrice" to use this value in the script. Checked the result via "Alert" and got - 1.6103. Here is the code:

int start()
{
OrderSelect(1,SELECT_BY_POS);
double OP=OrderOpenPrice();
double OPP=NormalizeDouble(OP,16);
Alert("Opening Price ",OPP);
return(0);
}

What should I do to get the exact price value as an output? Thanks in advance.

 
exsistentia:

Hello comrades! I apologise at once for the nouveau riche question. The opening price of the order is 1.61029. I used "OrderOpenPrice" to use this value in the script. Checked the result via "Alert" and got - 1.6103. Here is the code:

int start()
{
OrderSelect(1,SELECT_BY_POS);
double OP=OrderOpenPrice();
double OPP=NormalizeDouble(OP,16);
Alert("Open Price ",OPP);
return(0);
}

What do I need to do to get the exact price value in the output? Thank you in advance.


If you opened Buy, on Asc, then this is the price on Bid! That's right, the difference is spread + slippage, which needs to be taken into account! And you can't open exactly, everything is on the move! ;)
 
borilunad:

If you opened a Buy, on Asc, it's the price on the Bid! That's right, the difference is spread + slippage, which needs to be taken into account! And you can't open exactly, everything is in motion! ;)

Apparently I didn't explain the problem accurately. I have an open order GBPUSD (not a pending one) and the open price is 1.61029. The function OrderOpenPrice, as I see it, should return the actual open price of the order (1.61029) but it returns a value rounded off to 4 decimal places, 1.6103. Tested on different orders with different open prices - the result is the same: the last digit is missing.
 
How do I write a script that determines how many of the last 100 bars have crossed a certain horizontal line?
 
exsistentia:

Apparently I didn't explain the problem accurately. The thing is, there is an open GBPUSD order (not pending), the open price is 1.61029. The function OrderOpenPrice, as I understand it, is supposed to return the real open price of the order (1.61029). However, it returns a value rounded off to 4 decimal places, 1.6103. Tested on different orders with different open prices - the result is the same: the last digit is missing.


For that, there's DoubleToStr(), which will write with real Digits, but will write with 4! See the Documentation at the top left, you'll find everything there and learn a lot + tutorial!

There you go:

Alert("Цена открытия ",OPP);// не так

Alert("Цена открытия ",DoubleToStr(OPP,Digits);// а так