Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 6. - page 1113
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
This works with a crutch, but it also swaps out the history for new characters.
Good afternoon, dear forum members. Please don't get hurt, I'm just writing my thesis and want to do some sociological research. For sure there are people who have bought EAs once or several times. Please tell us, what criteria were important and crucial for you when buying? For example, it may be:
-type of Expert Advisor (trend, sesh, martingale, scalper...)
-History inthe strategy tester
-some specific functions of the Expert Advisor
-detailed description of how the EA works and how it is set up
-seller rating
- EA price
-campaigns and discounts
Or maybe something else.
And were you happy with your purchase?
Thank you very much for your understanding and answers
Good afternoon, dear forum members. Please don't get hurt, I'm just writing my thesis and want to do some sociological research. For sure there are people who have bought EAs once or several times. Please tell us, what criteria were important and crucial for you when buying? For example, it may be:
-type of Expert Advisor (trend, seth, martingale, scalper...)
-History inthe strategy tester
-some specific functions of the Expert Advisor
-detailed description of how the EA works and how it is set up
-seller rating
- EA price
-campaigns and discounts
Or maybe something else.
And were you happy with your purchase?
Thank you very much for your understanding and answers
Can you tell me where the error is? The values of the array elements Koef[] are calculated, each element is assigned a value. Why isn't Buffer1[] assigned?
#property link "https://www.mql5.com"
#property version "1.00"
#property strict
#property indicator_separate_window
#property indicator_buffers 1
#property indicator_level1 0.8
#property indicator_level2 -0.8
#property indicator_levelcolor Black
#property indicator_color1 Blue
#property indicator_minimum -1
#property indicator_width1 2
#property indicator_style1 0
#property indicator_maximum 1
double Buffer1[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
//--- indicator buffers mapping
SetIndexBuffer(0, Buffer1);
SetIndexStyle(0, DRAW_LINE);
return(0);
//---
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()
{
int n=25; // количество элементов в массиве(для периода H1 n=25, тк i<n)
int m=24; // количество массивов(для периода H1 m=24, тк p=0, p<m)
int w=18; // количество заков после запятой
double Price_CloseX[][24]; // Массив цен закрытия 1 пары
double Price_CloseY[][24]; // Массив цен закрытия 2 пары
double dx[][24]; // Отклонение от среднего значения для пары 1 dx
double dy[][24]; // Отклонение от среднего значения для пары 2 dy
double dx2[][24]; // Квадрат отклонения ср.значения dx2
double dy2[][24]; // Квадрат отклонения ср.значения dy2
double dxdy[][24]; // Произведение dx и dy
double sum_x[][24];
double sum_y[][24];
double Mx[][24]; // Массив среднего значения цен закрытия пары 1 Mx
double My[][24]; // Массив среднего значения цен закрытия пары 2 My
double Edx2[][24]; // Сумма квадратов отклонений Edx2
double Edy2[][24]; // Сумма квадратов отклонений Edy2
double Edxdy[][24]; // Сумма произведений отклонений Edxdy
double Koef[];
ArrayResize(Price_CloseX, n);
ArrayResize(Price_CloseY, n);
ArrayResize(dx, n);
ArrayResize(dy, n);
ArrayResize(dx2, n);
ArrayResize(dy2, n);
ArrayResize(dxdy, n);
ArrayResize(sum_x, n);
ArrayResize(sum_y, n);
ArrayResize(Mx, n);
ArrayResize(My, n);
ArrayResize(Edx2, n);
ArrayResize(Edy2, n);
ArrayResize(Edxdy, n);
ArrayResize(Koef, n);
string sym_x="EURUSD";
string sym_y="GBPUSD";
for(int i=1; i<n; i++)
{
for(int p=0; p<m; p++)
{
Price_CloseX[i][p]=iClose(sym_x, PERIOD_H1, i+p);
Price_CloseY[i][p]=iClose(sym_y, PERIOD_H1, i+p);
}
}
for(int i=1; i<n; i++)
{
for(int p=0; p<m; p++)
{
sum_x[i][p]=sum_x[i][p-1]+Price_CloseX[i][p];
sum_y[i][p]=sum_y[i][p-1]+Price_CloseY[i][p];
}
}
for(int i=1; i<n; i++)
{
for(int p=0; p<m; p++)
{
Mx[i][p]=sum_x[p+1][m-1]/(n-1);
My[i][p]=sum_y[p+1][m-1]/(n-1);
}
}
for(int i=1; i<n; i++)
{
for(int p=0; p<m; p++)
{
dx[i][p]=Price_CloseX[i][p]-Mx[i][p];
dy[i][p]=Price_CloseY[i][p]-My[i][p];
}
}
for(int i=1; i<n; i++)
{
for(int p=0; p<m; p++)
{
dx2[i][p]=(dx[i][p]*dx[i][p])*1000000;
dy2[i][p]=(dy[i][p]*dy[i][p])*1000000;
}
}
for(int i=1; i<n; i++)
{
for(int p=0; p<m; p++)
{
dxdy[i][p]=(dx[i][p]*dy[i][p])*1000000;
}
}
for(int i=1; i<n; i++)
{
for(int p=0; p<m; p++)
{
Edx2[i][p]=(Edx2[i-1][p]+dx2[i][p]);
Edy2[i][p]=(Edy2[i-1][p]+dy2[i][p]);
Edxdy[i][p]=(Edxdy[i-1][p]+dxdy[i][p]);
}
}
for(int p=0; p<m; p++)
{
Koef[p]=Edxdy[n-1][p]/sqrt(Edx2[n-1][p]*Edy2[n-1][p]);
Buffer1[p]=Koef[p];
Alert("Коэффициент корреляции Пирсона между ", sym_x, " и ", sym_y, " равен ", DoubleToString(Koef[p], w));
Alert("Значение буфера ", p, " равно ", Buffer1[p]);
}
return(0);
}
Good day! Do I get it right, if tp=2, sl=20 and spread=2 the probability of tp=(2+2)/(20-2)=0.22.... or do I need to multiply by some coefficient? And if true tp=0.22, then ideally we can open 3 trades in a row with these parameters, and 4 of the deal to skip?
I won't give a link, people think differently. I recommend starting from the principle of hopelessness of building the Grail. In this case, at a given TP and SL, it may be formulated as follows:
In the absence of spread, expected payoff in any series of trades with the same SL and the same TP is zero.
Expectation of profit without spread equals P(TP)*TP-P(SL)*SL=0, where SL and TP are distances from the trade opening level to their levels, P is the probability of trade completion by SL or TP, respectively.
From the condition of completion of all deals P(TP)+P(SL)=1, where P(TP)*TP-(1-P(TP))*SL=0, P(TP)*(TP+SL)=SL and
P(TP)=SL/(SL+TP).
To take the spread into account, we need to replace zero profit expectation with loss expectation of the spread size, P(TP)*TP-P(SL)*SL=Spread, and derive the required formula.
I won't give you the link, people think differently. I recommend to start from the principle of the hopelessness of building the Grail. In this case, for the given TP and SL, it may be formulated as follows:
In the absence of spread, expected payoff in any series of trades with the same SL and the same TP is zero.
Expectation of profit without spread equals P(TP)*TP-P(SL)*SL=0, where SL and TP are distances from the trade opening level to their levels, P is the probability of trade completion by SL or TP, respectively.
From the condition of completion of all deals P(TP)+P(SL)=1, where P(TP)*TP-(1-P(TP))*SL=0, P(TP)*(TP+SL)=SL and
P(TP)=SL/(SL+TP).
To take the spread into account, we need to replace the zero expected payoff with an expectation of loss equal to the spread, P(TP)*TP-P(SL)*SL=Spread, and derive the required formula.
Asking about the coefficient, I remember something like C(n,k), i.e. P(x)=C(n,k)*P(y/x)..... Anyway, I'm confused... I'll have to flip through the book.
If we are talking about books on probability theory, and judging by the hint of the number of combinations of n by k C(n,k), this is combinatorics, then there are no answers to the question posed in probability theory. Specifically the formula P(TP)*TP-P(SL)*SL=0
I got it empirically. In searching for such a combination of SL and TP that would give even the smallest statistically significant deviation from zero. The database of tick histories for 25 currency pairs was collected about 300 weeks from 50-60 dealing centres, there were 50 billion ticks in it at that time. I've tried dozens of methods of regular or pseudo-random opening of deals. The rate without the spread was considered the arithmetic average of the Bid and Ask.
If we are talking about books on probability theory, and judging by the hint of the number of combinations of n by k C(n,k), this is combinatorics, then there are no answers to the question posed in probability theory. Specifically the formula P(TP)*TP-P(SL)*SL=0
I got it empirically. In searching for such a combination of SL and TP that would give even the smallest statistically significant deviation from zero. The database of tick histories for 25 currency pairs was collected about 300 weeks from 50-60 dealing centres, there were 50 billion ticks in it at that time. I've tried dozens of methods of regular or pseudo-random opening of deals. The rate without spread was considered the arithmetic average of the Bid and Ask.
I.e. theory and practice are the same. 300 weeks is more than 5 years just to confirm the theory?
Why just for this, such a simple theory about the impossibility of winning without a prediction? I didn't say that... This amount of data is interesting in itself, there are 80 billion of them now. And the implications of this theory are many, in particular, the hopelessness of any martingale scheme, however twisted. And also other series, which are not based on predictions, but on very different signs, not related to the prediction.
If you open randomly, yes, expectation of profit is exactly equal minus spread. Signals are another matter, they may have their own expected payoff characterizing the quality of their forecasts. But it cannot be estimated, we can only take a sampling average, not expected value. And I think I don't need to tell you how samples are created.