GithubHelp home page GithubHelp logo

Comments (3)

xhad avatar xhad commented on July 24, 2024 3

wow. mkmark's genetic forex module is fascinating.

from forex.analytics.

askmike avatar askmike commented on July 24, 2024 1

Marek,

Thanks for your explanation. I think I can definitely use this project (just to play around). The main thing I need to overcome before I can use it myself:

Because of high fees and spreads placing orders is very expensive. So instead of going long when an uptrend is identified and selling the long position as soon as there is some profit (to minimize risk), most people (in cryptocurrency trading) stay long until their indicators tell them that the trend is going down instead of up.

If I would like to mimic behaviour in your simulation, I probably need to change some stuff deep inside the simulation logic.

Regards,

Mike

from forex.analytics.

mkmarek avatar mkmarek commented on July 24, 2024

Hi,
thanks, I appreciate that you like this project.

About the first point:
There is a spread option which I added to this project some time ago. Perhaps that could deliver the functionality you want. You can have a look on the development branch to see more details.
But basically there are two new parameters required for the config object in the findStrategy function.

  • pipInDecimals which contains a decimal value of one pip e.g. 0.0001 for EURUSD
  • spread which is the fee for each trade.When It calculates the pure revenue it does it like this:
double spreadValue = args.pipInDecimals * args.spread;
double revenue = trades->at(i).getRevenue() - spreadValue;

You can find the actual code here.

I can by the end of today make a merge with the master branch and put it on npm so it's available through normal channels. I also fiddled around with the fitness function a bit and after that the solution didn't really work that well. But I'm guessing you'll have to do some trial and error as well to get a decent results.

About the second one:
Yes the reason was exactly to cover the worst case scenario. But the fitness function can also use the getRevenue method from a specific trade. In the latest changes here I left this approach and just compared the close values with the getRevenue method.

Also the code you had a look on was calculating something called maximumPotentialLoss and profit which are boundaries in which the price oscilated during a specific trade. Quite interesting data for considering SL and TP strategy.

But in the end due to high liquidity of the currency pairs I'm aiming for right now I haven't really considered including this into the algorithm.

Also just a little disclaimer. This library is a result of quite limited knowledge about genetic programming and C++ as well I have to admit. 😃 but since I've learned a lot more since then I'm preparing a new version which should hopefully be publishable soon and should give more flexibility and more variations when it comes to defining trees, data normalization, selection algorithms, etc.. and most of all it shouldn't rely so much on mutations. that's why I haven't touched this project for quite some time.

Happy trading!

Marek

from forex.analytics.

Related Issues (13)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.