[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

 
gyvenor:

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?

You can do MA and fractal in Excel itself, paste the formula in the cell.
 

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).

 
Techno:
Attach a proper report. Better yet, a full report, you'll see.

Symbol EURUSD (Euro vs US Dollar)
Period 30 Minutes (M30) 1999.01.06 15:30 - 2010.11.09 21:59
Model By open prices (only for Expert Advisors with explicit bar opening control)
Parameters
Bars in history 143757 Modelled ticks 287336 Simulation quality n/a
Chart mismatch errors 0
Initial deposit 1000000.00
Net profit 23885.09 Total profit 50787.58 Total loss -26902.49
Profitability 1.89 Expected payoff 2.66
Absolute drawdown 73.00 Maximum drawdown 355.90 (0.03%) Relative drawdown 0.03% (355.90)
Total trades 8996 Short positions (% win) 0 (0.00%) Long positions (% win) 8996 (87.36%)
Profitable trades (% of all) 7859 (87.36%) Loss trades (% of all) 1137 (12.64%)
Largest profitable trade 10.50 losing deal -40.40
Average profitable deal 6.46 Deal loss -23.66
Maximum continuous wins (profit) 110 (730.00) Continuous losses (loss) 5 (-125.00)
Maximum Continuous Profit (number of wins) 730.00 (110) Continuous loss (number of losses) -125.00 (5)
Average continuous winnings 9 Continuous loss 1
Graph
Time Type Order Volume Price S / L T / P
 

The difference between M1 all ticks and M30 is minimal.

Symbol EURUSD (Euro vs US Dollar)
Period 1 Minute (M1) 1999.10.01 03:17 - 2010.11.09 21:06
Model All ticks (most accurate method based on all smallest available timeframes)
Parameters
Bars in history 3798097 Modelled ticks 37584894 Modeling quality 25.00%
Chart mismatch errors 0
Initial deposit 1000000.00
Net profit 19436.09 Total profit 42746.64 Total loss -23310.55
Profitability 1.83 Expected payoff 2.57
Absolute drawdown 6.00 Maximum drawdown 254.80 (0.03%) Relative drawdown 0.03% (254.80)
Total trades 7566 Short positions (% win) 0 (0.00%) Long positions (% win) 7566 (87.09%)
Profitable trades (% of all) 6589 (87.09%) Loss trades (% of all) 977 (12.91%)
Largest profitable trade 10.50 losing transaction -40.40
Average profitable deal 6.49 Deal loss -23.86
Maximum continuous wins (profit) 62 (410.00) Continuous losses (loss) 5 (-125.00)
Maximum Continuous Profit (number of wins) 410.00 (62) Continuous loss (number of losses) -125.00 (5)
Average continuous winnings 9 Continuous loss 1
Graph

 

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;
}
}

 
marten82:

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.
 
-marten82:

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.
 
paukas:
Here is the root of the evil.
I was guessing. Could you help me with the right condition? Because something's not working for me.
 

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?



 
asc9:

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.
Reason: