[WARNING CLOSED!] Any newbie question, so as not to clutter up the forum. Professionals, don't go by. Can't go anywhere without you. - page 938

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
here's an example from the boys =)
Thanks for the reply. Sketched out a rudimentary EA. It still does not work.
extern int HourStartTrade = 14;
extern int MinuteStartTrade = 30;
extern int TakeProfit = 690;
extern int StopLoss=250;
static int PrevTime=0;
extern int DeltaTimenow=1200;
int start()
{
if (Time[0]<=PrevTime) return(0);
{
PrevTime=Time[0];
int ticket;
if (Hour () == HourStartTrade && Minute() == MinuteStartTrade)
{
ticket=OrderSend(Symbol(),OP_BUY,0.1,Ask,3,Ask-StopLoss*Point,Ask+TakeProfit*Point, "EMA BUY",0,0,CLR_NONE);
datetime expiration = 0;
expiration = {(TimeCurrent() + DeltaTimenow)};
Print("expiration = ",expiration);
ticket=OrderSend(Symbol(),OP_SELLSTOP,0.1,Ask-StopLoss*Point,3,Bid,Ask-StopLoss*Point, "EMA SELL",expiration,0,CLR_NONE);
}
}
}
return(0);
You need to adjust the digits for the yen if you are working with it and the order symbol contains JPY. Do not worry - this function will do everything for you. And it should be placed, as well as any other functions outside the body of the EA. And you should call it from the EA as follows:
beyond the int start function, or beyond any function in the int start body?
Can anyone tell me where to get the settings files in Metatrader, after testing the EA in the tester, and the test report
Have you tried saving it?
Have you tried saving?
I need a file to send to the programmer
I was saving an image - that's not it
And save it as a report? Or save it as an itemised report? You can try it, rather than writing questions right away... And then wait for an answer...
extern double TP=20; // ТР для открываемого ордера
extern double Lot=0.01; // Жестко заданное колич. лотов
datetime time;
//--------------------------------------------------------------- 2 --
int start()
{
int Total;
double
M_0,
M_1;
bool
Ans =false, // Ответ сервера после закрытия
Cls_B=false, // Критерий для закрытия Buy
Cls_S=false, // Критерий для закрытия Sell
Opn_B=false, // Критерий для открытия Buy
Opn_S=false; // Критерий для открытия Sell
//--------------------------------------------------------------- 3 --
// Учёт ордеров
for(int i=OrdersTotal()-1;i>=0;i--)
if (OrderSelect(i,SELECT_BY_POS)&&OrderSymbol()==Symbol()&&OrderType()>1)Total++;
if(Total!=0 || time==Time[1])return;
// Торговые критерии
M_0=iOsMA(NULL,0,13,34,8,0,0); // 0 бар
M_1=iOsMA(NULL,0,13,34,8,0,1); // 1 бар
if (M_1<0 && M_0>0)
Opn_B=true;
if (M_1>0 && M_0<0)
Opn_S=true;
//--------------------------------------------------------------- 7 --
if (Opn_B)
{OrderSend(Symbol(),OP_BUY,Lot,Ask,0,Bid-SL*Point,Bid+TP*Point);time=Time[1];}
if (Opn_S)
{OrderSend(Symbol(),OP_SELL,Lot,Bid,0,Ask+SL*Point,Ask-TP*Point);time=Time[1];}
}