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
They're there for the story. (Really all white, which is totally in line with the advertisement, I confirm).
And no one in their right mind would use something just because it is open, without understanding how it works.
The implementation requires the enumeration of all variants. The total number of variants is 2 to the power of N, where N is the number of instruments in the portfolio. Maybe someone can help - with ready code. I would be very grateful.
Optimised for the drawdown. The line is now straighter. But in the course of my thinking, a question suddenly arose. How do you calculate the spread? After all, you need to know how many deals will be done and in what volumes! I do not consider the spread in my indicator, but I have tried to count how many points we will lose/gain on swaps. During optimization swaps are not considered.
Warning! I strongly recommend not to use a large number of currency pairs and the number of bars to be analyzed.
When optimizing by drawdown of 10 currency pairs and the parameter Lengh = 100 the indicator initializes about 5 seconds! Have patience :)
Example of filling the ET_para.csv file, which should be in the files folder:
The first line is used for the header and is not included in the calculations!
Optimised for the drawdown. The line is now straighter. But in the course of my thinking, a question suddenly arose. How do you calculate the spread? After all, you need to know how many deals will be done and in what volumes! I do not consider the spread in my indicator, but I have tried to count how many points we will lose/gain on swaps. During optimization swaps are not considered.
Warning! I strongly recommend not to use a large number of currency pairs and the number of bars to be analyzed.
When optimizing by drawdown of 10 currency pairs and the parameter Lengh = 100 the indicator initializes about 5 seconds! Have patience :)
Good job...
Spread and swap are not taken into account. The indicator only works with points.
If we take into account volume, spread and pip value, we get a virtual Equity curve, which directly depends on the correct values of these parameters. We need to calculate the pip value on each bar for all instruments in the portfolio in the deposit currency. In many brokerage houses the spread value varies, which will significantly distort the curve.
I am interested in your algorithm for trying all the options. I would be very grateful for your help.
The options matrix is formed as follows:
To make it easier to understand this code, I have uploaded an Excel spreadsheet with formulas for forming such a private matrix.
Then you just have to run through all the variants by brute force :)
The options matrix is formed as follows:
To make it easier to understand this code, I have uploaded an Excel spreadsheet with formulas for forming such a private matrix.
All you need to do after that is run through all variants :)
spb
Wrote a simpler code:
The variant number is represented as a binary number system.Added a display of drawdown and profit factor (ratio of current balance to maximum drawdown). The bigger this number is, the more stable the chart looks. Optimization is carried out by this value.
The number of seconds spent on the optimization is shown in comments. :)
EvgeTrofi:
Attention! I strongly recommend not to use a large number of currency pairs and the number of analyzed bars.
When optimizing the drawdown of 10 currency pairs and the parameter Lengh = 100, the indicator initializes about 5 seconds!!! Have patience :)
I have thought of a way to circumvent the limitation on the number of bars. It is necessary to divide the time frame for optimization by a number, for example, 100. If there are 1000 bars in the interval, we will get 1000 / 100 = 10 time points where we can perform calculations. Thus, the smaller is the number, the higher is the calculation accuracy.
I've been scratching my head about this too. It turns out that the fewer sections, the higher the probability of adjustment.
On the other hand, R-Portfolio uses payment matrices, among which the most informative are square ones, i.e. how many financial instruments are analyzed, so many sections should be there.
But the point is that even well correlated instruments can change correlation signs at certain moments. I.e. if you break up the fragments as you see fit, then there is a possibility that the analysis may contain just such bad moments with the changed signs.
In short, I came to a conclusion that we should not divide sections at equal intervals (with the same number of bars), but at extremums of some single instrument (for example, the one having the maximal share in the portfolio). I.e. apply ZigZag or some other algorithm, detect breakpoints of trends and by these points (on these bars only) discount quotes for further feeding to R-Portfolio (or some other portfolio analysis program). It seems to be the most kosher and most informative way. Otherwise, we get some kind of noise analysis between the points of correction changes, for example, in sideways.