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

 
silatyt:
Find the line: #include <strlib.mgh>

and replace with: #include <stdlib.mgh>.

And I have both such and such library. The second came with the EA. But when compiling it the editor doesn't see it and gives an error.

 
And find the line: #include <strlib.mqh>
and replace with: #include <stdlib.mqh>.
 
It was silatyt who misprinted and I repeated =). The message above is correct. Error 'strlib.mqh' - cannot open the program file
 
oDin48:
It was silatyt who misprinted and I repeated =). The message above is correct. The error is 'strlib.mqh' - cannot open the program file

check if it exists in terminal/experts/includes/ folder
 
FAQ:

check its presence in the terminal/experts/includes/ folder
Thank you. Problem solved. I thought they had to be put in the libraries. =)
 

Help me properly insert for this array, functions to move sl to breakeven, at a certain profit in a trade.

extern int tp = 0; // profit value

extern int sl = 0; // value of loss

extern int BeginHour = 0; // time of trade start
extern int EndHour = 0; // time of trade end


extern int lots =0;




int start()
{

//-- Buy trade. Checks if there are no open orders and the close price of the previous bar is lower than the open price.
//-- Buy order when the current Buy price reaches the High of the previous bar. Time period when the robot will perform the trade.

if (OrdersTotal()==0 && Hour() >= BeginHour && Hour() < EndHour && Close[1]<Open[1] && High[1]<Bid )
OrderSend(Symbol(),OP_BUY,lots,Ask,0,Ask-sl*Point,Ask+tp*Point,"",777,0,Red);


if (OrdersTotal()==0 && Hour() >= BeginHour && Hour() < EndHour && Close[2]<Open[2] && High[2]<Bid )
OrderSend(Symbol(),OP_BUY,lots,Ask,0,Ask-sl*Point,Ask+tp*Point,"",777,0,Red);

//if (OrdersTotal()==0 && Hour() >= BeginHour && Hour() < EndHour&& Close[3]<Open[3] && High[3]<Bid )
// OrderSend(Symbol(),OP_BUY,Ask,0,Ask-sl*Point,Ask+tp*Point,"",777,0,Red);


//-- Sell trade. Check if there are no open orders and the close price of the previous bar is higher than the open price.
//-- Sell order when the current bar's Bid price reaches the Low of the previous bar. Time period when the robot will perform the trade.

if (OrdersTotal()==0 && Hour() >= BeginHour && Hour() < EndHour && Close[1]>Open[1] && Low[1]>Bid )
OrderSend(Symbol(),OP_SELL,lots,Bid,0,Ask+sl*Point,Ask-tp*Point,"",777,0,Red);

if (OrdersTotal()==0 && Hour() >= BeginHour && Hour() < EndHour && Close[2]>Open[2] && Low[2]>Bid )
OrderSend(Symbol(),OP_SELL,lots,Bid,0,Ask+sl*Point,Ask-tp*Point,"",777,0,Red);

//if (OrdersTotal()==0 && Hour() >= BeginHour && Hour() < EndHour && Close[3]>Open[3] && Low[3]>Bid )
//OrderSend(Symbol(),OP_SELL,lots,Bid,0,Ask+sl*Point,Ask-tp*Point,"",777,0,Red);

//----

//----


return(0);
}
 

Hello, can you tell me how to find the integer part.

double PriceHigh = iHigh   (NULL,PERIOD_D1,1); // присвоение переменной максимального значение цены с 1 бара
double PriceLow  = iLow    (NULL,PERIOD_D1,1);  // присвоение переменной минимального значение цены с 1 бара
teloCendle = (PriceHigh-PriceLow); // находим общий ценовой диапозон в пунктах

I get a fractional number, "0.0053 for example", but how do I go to just 53? in order to find the volume in pips of the previous candle...

 
frixer:

Hello, can you tell me how to find the integer part.

I get a fractional number, "0.0053 for example", but how do I go to just 53? in order to find the volume in pips of the previous candle...

I tried multiplying by 10,000 does not work, I would be grateful in advance
 
frixer:

Hello, can you tell me how to find the integer part.

I get a fractional number, "0.0053 for example", but how do I go to just 53? in order to find the volume in pips of the previous candle...

double PriceHigh = iHigh(NULL,PERIOD_D1,1); // присвоение переменной максимального значение цены с 1 бара
double PriceLow  = iLow(NULL,PERIOD_D1,1);  // присвоение переменной минимального значение цены с 1 бара
int teloCendle = (PriceHigh-PriceLow) * 10000; // находим общий ценовой диапозон в пунктах
 
Zhunko:


Thanks of course, but I tried then after the decimal remains decimal, and rounded as it is not clever enough ;(
Reason: