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.
//-- 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.
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
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.
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
check its presence in the terminal/experts/includes/ folder
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 lossextern 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.
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...
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...
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...