[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 1066

 
Melena:

Hello, dear forum members, very much looking forward to your help.....

So the question is what you think, dear experts in the field, whether I'm thinking in the right direction, and if not, please advise what can be done with this data, how and where to apply linear regression? what hypothesis can be created and then confirm or deny? I am far from an expert in this field myself, I have never encountered statistics before, let alone the exploratory method(((.

Thanks in advance!

Sincerely,

Milena.

During the year the number of clients changes drastically (so I understand), then you need to consider the dynamics of changing the number of people being treated(history repeats itself).

Get attached to the time, on the 1st of December every year I go where ...

And so on all points

Or there is a good method of minimizing

http://www.google.com.ua/search?source=ig&hl=ru&rlz=1G1GGLQ_RUUA357&=&q=%D0%97%D0%B0%D0%B4%D0%B0%D1%87%D0%B0+%D0%BC%D0%B8%D0%BD%D0%B8%D0%BC%D0%B8%D0%B7%D0%B0%D1%86%D0%B8%D0%B8+%D1%83%D0%BF%D1%83%D1%89%D0%B5%D0%BD%D0%BD%D0%BE%D0%B9+%D0%B2%D1%8B%D0%B3%D0%BE%D0%B4%D1%8B&btnG=%D0%9F%D0%BE%D0%B8%D1%81%D0%BA+%D0%B2+Google&aq=f&oq=

Desktop_1.zip (2 871.41 KB) delete

 
granit77:

Print(iMA("EURUSD", PERIOD_D1, 14, 0, MODE_SMA, PRICE_CLOSE,0));

This is more accurate.
:) Sleeping on the move... :)
 
marker:

In principle, this is probably what will happen. One account, 8 terms, 8 scripts each will save their trades in a separate folder (sorted by magic). Why do I want one account, because I want to look at the curve of the whole portfolio....something like this....s are now hanging separately. Thanks for the reply:)) Although, it would be more convenient if all trades were stored in one file, but sorted, it would be more convenient, all sorted in one file.

There is such a thing, but you are not a coder ;))

https://www.mql5.com/ru/code/8051

 

Hello !

Can you please tell me what is the profitability of 981 ? Is it possible ? Is it that the sum of all positive profits is 981 times the sum of all losses ? (but the profit is 24 and the drawdown is 13... something I do not understand....). I optimise by the "Profit Factor".

Where is the $13 drawdown here...?


Here is the test report:


 

Yes!!! Extremely interesting. The result is beyond anything, I'm not good at testing myself.

I do not understand anything!!!!!!!! I decided to prescribe a trailing stop to my Expert Advisor.

The variable vzlet counts how many points the price moved up, compared to the moment when I opened the order; the variable newloss is a new loss; it is equal to the size by how many points it will move when order is moved and inside the order-modify it is written in a very simple and clear way Bid+newloss*PointX

Having received error 130, for fun I created a variable bylstop=Bid+stoploss*PointX; -bylstop, which remembers how big the stop was when the order was opened,

-The result is amazing-the difference between newloss and bylstop sometimes exceeds 200 pips and usually not less than 100 pips. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Of course, the error is 130! But how can it be!!!!!! The formulas are extremely simple!!! No error!!!! Or am I a complete moron? I've been watching for three days, I don't understand!!!!

//+------------------------------------------------------------------+
//| mpm.mq4 |
//| Dimon |
//| http://www.metaquotes.net |
//+------------------------------------------------------------------+
#property copyright "Dimon"
#property link "http://www.metaquotes.net"

//+------------------------------------------------------------------+
//| expert initialization function |
//+------------------------------------------------------------------+

extern int BandsPeriod=20, i=1; extern int BandsShift=0;
extern double BandsDeviations=2.0;
extern double Lots=0.1, TakeProfit=60, stoploss=25; double PointX;


int init()
{ if(Digits==5 || Digits==3) PointX = Point * 10; // Correction Point for three or five digits
if(Digits==4 || Digits==2) PointX = Point;
//----

//----
return(0);
}
//+------------------------------------------------------------------+
//| expert deinitialisation function |
//+------------------------------------------------------------------+
int deinit()
{
//----

//----
return(0);
}
//+------------------------------------------------------------------+
//| expert start function |
//+------------------------------------------------------------------+
double order; int ticket;double bylstop;
int start()
{double newloss=12; Alert ("ticket",ticket);
double vzlet= (Close[1]-order)/PointX;

Alert ("vzlet",vzlet); int total=OrdersTotal();// Comment(" total ",total); Alert (" total ",total);
Alert ("PointX",PointX);


if (vzlet>=20)
{ for(int i = 0; i < total; i++)
{ OrderSelect( ticket,SELECT_BY_TICKET,MODE_TRADES );
if(OrderSymbol() == Symbol()&&OrderMagicNumber() == 16384 &&OrderType() == OP_BUY)

OrderModify(OrderTicket(),OrderOpenPrice(),Bid+newloss*PointX,OrderTakeProfit(),0,Blue);
Alert ("Modification error",GetLastError());Alert ("newlossbuy",Bid+newloss*PointX);Alert ("bylstopbuy",bylstop);}


if (vzlet<=(-20))
{ for( i = 0; i < total; i++)
{ OrderSelect( ticket,SELECT_BY_TICKET,MODE_TRADES );
if(OrderSymbol() == Symbol() && OrderMagicNumber() == 16384&&OrderType() == OP_SELL)

OrderModify(OrderTicket(),OrderOpenPrice(),Ask-newloss*PointX,OrderTakeProfit(),0,Blue);
Alert ("Modification error",GetLastError()); Alert ("newlosssell",Ask-newloss*PointX); Alert ("bylstopsell",bylstop); } }



if ( total !=0 ){return;}

double Average,Verhnyayaghranytsa,Nyzhnyayaghranytsa,newres,sum,deviation;
string text; int err;
text="macd sample;
Average=iMA(NULL,0,BandsPeriod,BandsShift,MODE_SMA,PRICE_CLOSE,i);
int k,counted_bars=IndicatorCounted();

//----
//----
for( k = 0; k<BandsPeriod; k++)
{ newres=Close[k]-Average;//Alert (" Average ",Average);
sum+=((newres*100)*(newres*100))/10000;//Alert (" newres ",newres);
}




deviation=BandsDeviations*MathSqrt(sum/BandsPeriod);
Verhnyayaghranytsa=Average+deviation;
Nyzhnyayaghranytsa=Average-deviation;//Alert (" sum ",sum);
// Alert (" deviation ",deviation);
//----
if (Verhnyayaghranytsa<Close[i])
{ Comment(" buoy ",Verhnyayaghranytsa );
ticket=OrderSend(Symbol(),OP_BUY,Lots,Ask,3,Ask-stoploss*PointX,Ask+TakeProfit*PointX, "macd sample",16384,0,Green);
Alert (" stoploss ",Ask-stoploss*PointX);order=Close[0];order=Close[0];bylstop= Ask-stoploss*PointX;Alert("Error",GetLastError());
}


if (Nyzhnyayaghranytsa>Close[i])
{ Comment(" sell! ",Nyzhnyayaghranytsa );

ticket=OrderSend(Symbol(),OP_SELL,Lots,Bid,3,Bid+stoploss*PointX,Bid-TakeProfit*PointX, "macd sample",16384,0,Red);
Alert (" stoploss ",Bid+stoploss*PointX);bylstop=Bid+stoploss*PointX;
Alert("ErrorOrdersell",GetLastError()); order=Close[0]; }

}
return(0);

//+------------------------------------------------------------------+

2010.12.22 14:22:09 2010.06.03 20:46 EURUSD,H1: Alert: bylstopsell1.2247

2010.12.22 14:22:09 2010.06.03 20:46 Thu Thunder EURUSD,H1: Alert: newlosssell1.2154

2010.12.22 14:22:09 2010.06.03 20:46 Thu Thunder EURUSD,H1: Alert: Modification Error130

2010.12.22 14:22:09 2010.06.03 20:46 Thu Thunder EURUSD,H1: OrderModify error 130

2010.12.22 14:22:04 2010.06.03 05:00 Thu Thunder EURUSD,H1: Alert: ticket2

2010.12.22 14:22:04 2010.06.03 05:00 Thu Thunder EURUSD,H1: Alert: PointX0.0001

2010.12.22 14:22:04 2010.06.03 05:00 Thu Thunder EURUSD,H1: Alert: vzlet16

2010.12.22 14:22:04 2010.06.03 05:00 Thu Thunder EURUSD,H1: Alert: ticket2

2010.12.22 14:22:04 2010.06.03 05:00 Thu Thunder EURUSD,H1: Alert: PointX0.0001

2010.12.22 14:22:04 2010.06.03 05:00 Thunder EURUSD,H1: Alert: vzlet16

I made up this cogconstruction if(OrderSymbol() == Symbol() && OrderMagicNumber() == 16384&&OrderType() == OP_SELL) to avoid writing three times,

I put OrderSelect( ticket,SELECT_BY_TICKET,MODE_TRADES ); and I put OrderModify(OrderTicket(),OrderOpenPrice(),Bid+newloss*PointX,OrderTakeProfit(),0,Blue);

and there is an error where it cannot be!!!!!!!!



Not only that, I multiplied PointX0.0001 by 10, and then divided (of course outside the loop), although this is fundamentally wrong, without understanding the reason, and got no less confusing

//+------------------------------------------------------------------+
//| mq4 |
//| Dimon |
//| http://www.metaquotes.net |
//+------------------------------------------------------------------+
#property copyright "Dimon"
#property link "http://www.metaquotes.net"

//+------------------------------------------------------------------+
//| expert initialisation function |

//+----------------

--------------------------------------------------+

extern int BandsPeriod=20, i=1; extern int BandsShift=0;
extern double BandsDeviations=2.0;
extern double Lots=0.1, TakeProfit=60, stoploss=25; double PointX;


int init()
{ if(Digits==5 || Digits==3) PointX = Point * 10; // Correction Point for three or five digits
if(Digits==4 || Digits==2) PointX = Point;
//----

//----
return(0);
}
//+------------------------------------------------------------------+
//| expert deinitialisation function |
//+------------------------------------------------------------------+
int deinit()
{
//----

//----
return(0);
}
//+------------------------------------------------------------------+
//| expert start function |
//+------------------------------------------------------------------+
double order; int ticket;double bylstop;
int start()
{double newloss=12; Alert ("ticket",ticket); PointX= PointX*10 ;
double vzlet= (Close[1]-order)/PointX;

Alert ("vzlet",vzlet); int total=OrdersTotal();// Comment(" total ",total); Alert (" total ",total);
Alert ("PointX",PointX);


if (vzlet>=20)
{ for(int i = 0; i < total; i++)
{ OrderSelect( ticket,SELECT_BY_TICKET,MODE_TRADES );
if(OrderSymbol() == Symbol()&&OrderMagicNumber() == 16384 &&OrderType() == OP_BUY)

OrderModify(OrderTicket(),OrderOpenPrice(),Bid+newloss*PointX,OrderTakeProfit(),0,Blue);
Alert ("Modification error",GetLastError());Alert ("newlossbuy",Bid+newloss*PointX);Alert ("bylstopbuy",bylstop);}


if (vzlet<=(-20))
{ for( i = 0; i < total; i++)
{ OrderSelect( ticket,SELECT_BY_TICKET,MODE_TRADES );
if(OrderSymbol() == Symbol() && OrderMagicNumber() == 16384&&OrderType() == OP_SELL)

OrderModify(OrderTicket(),OrderOpenPrice(),Ask-newloss*PointX,OrderTakeProfit(),0,Blue);
Alert ("Modification error",GetLastError()); Alert ("newlosssell",Ask-newloss*PointX); Alert ("bylstopsell",bylstop); } }



if ( total !=0 ){return;} PointX = PointX/10;

double Average,Verhnyayaghranytsa,Nyzhnyayaghranytsa,newres,sum,deviation;
string text; int err;
text="macd sample;
Average=iMA(NULL,0,BandsPeriod,BandsShift,MODE_SMA,PRICE_CLOSE,i);
int k,counted_bars=IndicatorCounted();

//----
//----
for( k = 0; k<BandsPeriod; k++)
{ newres=Close[k]-Average;//Alert (" Average ",Average);
sum+=((newres*100)*(newres*100))/10000;//Alert (" newres ",newres);
}




deviation=BandsDeviations*MathSqrt(sum/BandsPeriod);
Verhnyayaghranytsa=Average+deviation;
Nyzhnyayaghranytsa=Average-deviation;//Alert (" sum ",sum);
// Alert (" deviation ",deviation);
//----
if (Verhnyayaghranytsa<Close[i])
{ Comment(" buoy ",Verhnyayaghranytsa );
ticket=OrderSend(Symbol(),OP_BUY,Lots,Ask,3,Ask-stoploss*PointX,Ask+TakeProfit*PointX, "macd sample",16384,0,Green);
Alert (" stoploss ",Ask-stoploss*PointX);order=Close[0];order=Close[0];bylstop= Ask-stoploss*PointX;Alert("Error",GetLastError());
}


if (Nyzhnyayaghranytsa>Close[i])
{ Comment(" sell! ",Nyzhnyayaghranytsa );

ticket=OrderSend(Symbol(),OP_SELL,Lots,Bid,3,Bid+stoploss*PointX,Bid-TakeProfit*PointX, "macd sample",16384,0,Red);
Alert (" stoploss ",Bid+stoploss*PointX);bylstop=Bid+stoploss*PointX;
Alert("ErrorOrdersell",GetLastError()); order=Close[0]; }

}
return(0);

//+------------------------------------------------------------------+



2010.12.22 14:48:09 2010.06.03 07:40 GMT EURUSD,H1: Alert: PointX1.#INF

2010.12.22 14:48:09 2010.06.03 07:40 Thu Thunder EURUSD,H1: Alert: vzlet0

2010.12.22 14:48:09 2010.06.03 07:40 Thu Thunder EURUSD,H1: Alert: ticket-1

2010.12.22 14:48:08 2010.06.03 07:40 GMT,H1: Alert: PointX1.#INF

2010.12.22 14:48:08 2010.06.03 07:40 GMT,H1: Alert: vzlet0

2010.12.22 14:48:08 2010.06.03 07:40 GMT,H1: Alert: ticket-1

2010.12.22 14:48:08 2010.06.03 07:40 Thu Thu EURUSD,H1: Alert: PointX1.#INF.



 
I see, in the second version, if an order is open, PointX is no longer divided. But the main problem is not caught.
 

I don't understand the logic of assigning a ticket. It's not a sequential number, is it? It seems that the numbers of tickets increase as we go along.

But how can it be minus one!!!?

 
What is PointX, what is it for? Point is point, newloss*Point is newloss points
 

When I just wrote my first EA, it did not work, also wrote error 130, but not a modification, and opening of the order, on the forum advised, they say your platform is five digits, paste if(Digits==5 || Digits==3) PointX = Point * 10; // Point correction for three-five digits
if(Digits==4 || Digits==2) PointX = Point; I pasted, everything worked!!!!!!!! I pasted, copied, but did not make it out, I figured out the error there, I'll figure it out myself.



 
Dimka-novitsek:

I don't understand the logic of assigning a ticket. It's not a sequential number, is it? It seems that the numbers of tickets increase as we go along.

But how can it be minus one!!!?

It is shown as "-1" if the order is not triggered. If the order is executed it is given a number.