[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 984
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
Thank you.
Is it possible to add columns with indicator value to this table? For example the MA value on a given bar. Or is there an up/down fractal?
Hello. Can you tell me if there is any publicly available transaction history of L.Williams from his 1987 legendary victory at the Championships? It would be interesting to have a look).
Attach a proper report. Better yet, a full report, you'll see.
The difference between M1 all ticks and M30 is minimal.
Good afternoon!
I need this EA to work on one account, but on different pairs. But unfortunately, if at least one trade is open, the EA does not open trades on other pairs, even if there is a signal. What is the mistake? Help me to understand!
And another question, is it necessary to change Magic in the settings when attaching the EA to the chart, if it has already been applied to another pair?
here is the code:
//////////////////////////////////////////////////////////////////////
// MUWINGS CROSSING //
//////////////////////////////////////////////////////////////////////
extern string Settings = "Main Settings"; ////////////////////////
extern int Magic = 227 ; //Individual number//.
extern double Lots =0.1 ;
extern int Slip = 5 ; //Slip/.
//data for time setting
extern string OpenTime = "01:05-23:05";
//------------------------------------------------------------------// //
//Indicators // //
//------------------------------------------------------------------// //
extern string Indicator1 = "MA-Slow" ; // // //
extern int MAPeriod1 = 55 ; //period //
extern int int MA1_shift = 0 ;
extern string Indicator2 = "MA-Fast" ; // // //
extern int int MAperiod2 = 13 ; //Period //
extern inttern MA2_shift = 0 ;
//------------------------------------------------------------------/////////////
int tiket1 , tiket2 , cnt;
int start()
{
//---------------------------------------------------------------------------------------------------------------//
double MA1 =iMA(NULL,0,MAPeriod1,MA1_shift,MODE_LWMA,PRICE_MEDIAN,0); //calculate MA indicator //
//Print("ma1=====",MA1);
double MA2 =iMA(NULL,0,MAperiod2,MA2_shift,MODE_LWMA,PRICE_CLOSE,0); //calculate MA indicator //
//Print("ma2=====",MA2);
string OTA[];
string OTI[];
split(OTA, OpenTime, ";");
datetime tm0 = CurTime();
datetime tm1, tm2;
bool cond = false;
int cnt = ArraySize(OTA);
for (int i=0; i < cnt; i++) {
split(OTI, OTA[i], "-");
if (ArraySize(OTI) != 2) continue;
tm1 = StrToTime(TimeToStr(CurTime(), TIME_DATE) + " + OTI[0]);
tm2 = StrToTime(TimeToStr(CurTime(), TIME_DATE) + " " + OTI[1]);
cond = cond || (tm1 <= tm0 && tm0 < tm2)
}
if (cond)
{
if(OrdersTotal()==0)
{
if((MA2>MA1)&&(Close[0]>MA2))
{
tiket1=OrderSend(Symbol(),OP_BUY,Lots,NormalizeDouble(Ask,Digits),Slip,0,0,NULL,Magic,0,CLR_NONE)
}
if((MA2<MA1)&&(Close[0]<MA2))
{
tiket2=OrderSend(Symbol(),OP_SELL,Lots,NormalizeDouble(Bid,Digits),Slip,0,0,NULL,Magic,0,CLR_NONE);
}
}
if(OrdersTotal()==1)
{
if((MA2>MA1)&&(Close[0]>MA2 ))
{
OrderClose(tiket2,Lots,Ask,Slip,Red);
}
if((MA2<MA1)&&(Close[0]<MA2))
{
OrderClose(tiket1,Lots,Bid,Slip,Red);
}
}
}
}
void split(string& arr[], string str, string sym)
{
ArrayResize(arr, 0);
string item;
int pos, size;
int len = StringLen(str);
for (int i=0; i < len;) {
pos = StringFind(str, sym, i);
if (pos == -1) pos = len;
item = StringSubstr(str, i, pos-i);
item = StringTrimLeft(item);
item = StringTrimRight(item);
size = ArraySize(arr);
ArrayResize(arr, size+1);
arr[size] = item;
i = pos+1;
}
}
Good afternoon!
extern string OpenTime = "01:05-23:05";
//------------------------------------------------------------------// //
//Indicators // //
//------------------------------------------------------------------// //
extern string Indicator1 = "MA-Slow" ; // // //
extern int MAPeriod1 = 55 ; //period //
extern int int MA1_shift = 0 ;
extern string Indicator2 = "MA-Fast" ; // // //
extern int int MAperiod2 = 13 ; //Period //
extern inttern MA2_shift = 0 ;
//------------------------------------------------------------------/////////////
int tiket1 , tiket2 , cnt;
int start()
{
//---------------------------------------------------------------------------------------------------------------//
double MA1 =iMA(NULL,0,MAPeriod1,MA1_shift,MODE_LWMA,PRICE_MEDIAN,0); //calculate MA indicator //
//Print("ma1=====",MA1);
double MA2 =iMA(NULL,0,MAperiod2,MA2_shift,MODE_LWMA,PRICE_CLOSE,0); //calculate MA indicator //
//Print("ma2=====",MA2);
string OTA[];
string OTI[];
split(OTA, OpenTime, ";");
datetime tm0 = CurTime();
datetime tm1, tm2;
bool cond = false;
int cnt = ArraySize(OTA);
for (int i=0; i < cnt; i++) {
split(OTI, OTA[i], "-")
if (ArraySize(OTI) != 2) continue;
tm1 = StrToTime(TimeToStr(CurTime(), TIME_DATE) + " + OTI[0]);
tm2 = StrToTime(TimeToStr(CurTime(), TIME_DATE) + " " + OTI[1]);
cond = cond || (tm1 <= tm0 && tm0 < tm2)
}
if (cond)
{
if(OrdersTotal()==0)
{
if((MA2>MA1)&&(Close[0]>MA2))
{
tiket1=OrderSend(Symbol(),OP_BUY,Lots,NormalizeDouble(Ask,Digits),Slip,0,0,NULL,Magic,0,CLR_NONE)
}
if((MA2<MA1)&&(Close[0]<MA2))
{
tiket2=OrderSend(Symbol(),OP_SELL,Lots,NormalizeDouble(Bid,Digits),Slip,0,0,NULL,Magic,0,CLR_NONE);
}
}
if(OrdersTotal()==1)
{
if((MA2>MA1)&&(Close[0]>MA2 ))
{
OrderClose(tiket2,Lots,Ask,Slip,Red);
}
if((MA2<MA1)&&(Close[0]<MA2))
{
OrderClose(tiket1,Lots,Bid,Slip,Red);
}
}
}
}
void split(string& arr[], string str, string sym)
{
ArrayResize(arr, 0);
string item;
int pos, size;
int len = StringLen(str);
for (int i=0; i < len;) {
pos = StringFind(str, sym, i);
if (pos == -1) pos = len;
item = StringSubstr(str, i, pos-i);
item = StringTrimLeft(item);
item = StringTrimRight(item);
size = ArraySize(arr);
ArrayResize(arr, size+1);
arr[size] = item;
i = pos+1;
}
}
I think where it's highlighted in red.
Good afternoon!
I need this EA to work on one account, but on different pairs. But unfortunately, if at least one trade is open, the EA does not open trades on other pairs, even if there is a signal. What is the mistake? Help me to understand!
And another question, is it necessary to change Magic in the settings when attaching the EA to the chart, if it has already been applied to another pair?
here is the code:
.......
if(OrdersTotal()==0)
Here is the root of the evil.
I have a good feeling that the EA is stubbornly refusing to log earlier than 21.45, although everything is correct in the code and there are no restrictions on it....see what the reason may be there plz? upd restarted the computer, on the first run were records from the beginning of the day, and then again all over again... it feels like something is cached, but what is it?
I have a good feeling about this, but I'm not sure what is wrong with it... I'm not sure what's wrong with it... I'm sure it's wrong... upd restarted the computer, on the first run were records from the beginning of the day, and then again all over again... it feels like something is cached, but what is it?
I think it's because of the first condition. Try Hour()<=22.