Machine learning in trading: theory, models, practice and algo-trading - page 2103

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
Do you happen to have a function that calculates both the net worth and the commission?
And you do not have by any chance a function which counts and equities and commission?
Language, exchange, forex? I don't know what you mean.
Language, Stock Exchange, Forex? I don't know what that means.
R-ka, forex.
Well a function that would calculate the balance chart for trades + commission\spread (costs)
I wrote this, I don't know if it's correct
Example of R script that uses "MetaTrader5" (Python) package to load quotes. The "reticulate" library must be installed in R. This library provides interaction with Python. Read carefully here and here. The first time you run the reticulate library you will be offered to install miniconda. I recommend that you do not refuse. This will create the conda environment r-reticulate with python(3.6.xx) and an initial set of packages installed. If you have already installed Pyhon (or several versions) at the beginning of the script you should activate required environment. All commands of MetaTrader5 package are here.
Initialization script
To download quotes we will write the function
Let's see the structure of obtained data.
Next, the necessary calculations.
R-card, forex.
Well, a function that would calculate the balance chart for trades + commission/spread (costs)
wrote this, I do not know if this is right
I do not understand here
R-card, forex.
Well, a function that would calculate the balance chart for trades + commission/spread (costs)
wrote this, I do not know if it is correct
I think that the number of deals should not be counted here. And just subtract spread with commission from each deal. That's how it is:
I think that the number of deals does not need to be counted here. And just subtract the spread with the commission from each deal. That's the way it is:
Not like that. For example
The commission will not be charged for each signal, but only when the signal is reversed. I use the function
For the signal vector above
The difference is not clear.
And for calculating the balance the function
Good luck
I don't get it here.
c "rle" you can count the number of signal changes, those number of deals
You can see by "values" that the signal changed 5 times, it means that there were 5 deals.
I do not understand the difference.
I think my implementation takes into account commission as if "of the first trade, the opening of which we don't have, there is only the closing"
Like for this deal, my variant takes a commission
and your version starts charging this one, your version is more correct, but it's easy to correct, just subtract "1"
Example script in R using ...
Thanks, I will look into it
With "rle" you can calculate the number of signal changes, i.e. number of deals
It is clear from "values" that the signal changed 5 times, so there were 5 trades.
I think my implementation also takes into account the commission and as "the first trade, the opening of which we do not have, there is only the closing"
like for this deal, my variant takes a commission
and your version starts to take this one, your version is more correct, but it's easy to correct, just do, just subtract "1"
Yes, your version is more correct.