[Archive!] Any rookie question, so as not to clutter up the forum. Professionals, don't pass it by. Couldn't go anywhere without you - 2. - page 481

 
jaguar19740724:

How do I determine the date of the relevant bar?

https://docs.mql4.com/ru/series/iTime
 
Sancho77:
Dear, could you please advise how to call Open[1] and Close[1] information from several TFs into an EA?
iOpen
 
Sancho77:
Dear, could you please advise how to call Open[1] and Close[1] information from several TFs into an EA?

iOpen(), iClose()
 
granit77:
A bzik and a B in Russian are different things. I have a solid B, I'm good enough.

When I was a student, they gave me a B in spelling and grammar - on a four-page essay - if I had 2-5 mistakes
 
Martingeil:
iOpen
Vinin:
iOpen(), iClose()
This is also in the FAQ.
HOW do I get Open and Close, of another currency, without opening its chart?
 
Thank you Martingeil, Vinin, granit77!
 
jaguar19740724:

How do I determine the date of the relevant bar?

время_бара = iTime(NULL,PERIOD_M1,бар);     
 
abolk:


see opening lines:

Now look at the specification of the OrderSend function itself (described here https://docs.mql4.com/ru/trading/OrderSend):

and check if the parameters are still there


redo please look at this variant
there is an error 4062 a parameter of type string is expected
I don't know what 'string' means or what it is.
//+------------------------------------------------------------------+
//| all.mq4 |
//| Copyright © 2011, MetaQuotes Software Corp.
//| http://www.metaquotes.net |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2011, MetaQuotes Software Corp.
#property link "http://www.metaquotes.net"

extern int Timeframe_Up15 =15;
extern int TakeProfit =100;
extern int StopLoss =100;
extern double Lot =0.1;
extern int Slippage =3;
extern int magic = 33;
//|******************************************************************************************|//
extern string Indicator_=" Indicator settings;
extern int JawsPeriod =13;
extern int JawsShift =8;
extern int TeethPeriod =8;
extern int TeethShift =5;
extern int LipsPeriod =5;
extern int LipsShift =3;
double green_line,blue_line,red_line;


//|******************************************************************************************|//
int start()
{
double blue_line=iAlligator(NULL, 0, 13, 8, 8, 5, 5, 3, MODE_SMMA, PRICE_WEIGHTED, MODE_GATORJAW,0);
double red_line=iAlligator(NULL, 0, 13, 8, 8, 5, 5, 3, MODE_SMMA, PRICE_WEIGHTED, MODE_GATORTEETH, 0);
double green_line=iAlligator(NULL, 0, 13, 8, 8, 5, 5, 3, MODE_SMMA, PRICE_WEIGHTED, MODE_GATORLIPS,0);
if(OrdersTotal()==0)
{
RefreshRates();//Function to refresh this one in predefined (Ask,Bid, etc.)
double ask =MarketInfo("EURUSD",MODE_ASK);
if (green_line>blue_line>red_line)
OrderSend(Symbol(),OP_BUY,Lot,Ask,Slippage,StopLoss,TakeProfit,magic);
}
{
RefreshRates();//Function to refresh this one in predefined (Ask,Bid, etc.)
double bid =MarketInfo("EURUSD",MODE_BID);
if (green_line<red_line<blue_line)
OrderSend(Symbol(),OP_SELL,Lot,Bid,Slippage,StopLoss,TakeProfit,magic);
}
return(0);
}
Files:
all_3.mq4  3 kb
 
novicek:

I glanced at the stoploss and takeprofit not written down correctly.

Yes, I missed the comment, I put the magician in right away.

OrderSend(Symbol(),OP_BUY,1,Ask,Slippage,Bid-StopLoss*Point,Ask+TakeProfit*Point,"",magic);

OrderSend(Symbol(),OP_SELL,1,Bid,Slippage,Ask+StopLoss*Point,Bid-TakeProfit*Point,"",magic);
 
Colleagues, I have reviewed the code a hundred times - I don't see any errors. The EA itself is trading, but in the log it generates a lot of errors: zero divide
The Expert Advisor is small, please take a look at it.
Files:
strategy1.mq4  4 kb