Data science question: best or simplest ML/DL/NN approach

Discussion in 'App Development' started by user1, Jun 13, 2020.

  1. user1

    user1

    In attempting to the predict behavior of top 5 most liquid currency futures, using Java API with Interactive Brokers, I plan to incorporate machine-learning type of feature for managing the trade—specifically the closing of position aspect—either to take a maximum profit or minimize loss.

    QUESTION: Given timeseries historical data containing examples of successful trading executions for the training, what is best machine-learning/deep-learning/neural-network technique/algorithm/approach for implementing a feature to an existing trading system, specifically to manage a trade after execution (position is opened) so as to take the maximum profit or incur the minimum loss in order to close position?


    I would surmise, generally it would be something like classification—incorporating min-max. Furthermore, the classification approach would specifically call for a Reinforcement Learning type of structure/environment. However—for now— with the caveat, because of the complexity of java coding required to make the reinforcement learning in real-time, I do not presently wish to pursue a real-time reinforcement-learning approach. Instead I would manually update the ARFF file every week or on weekly basis. ARFF is the file (containing timeseries historical data of trades) that contains the list of instances sharing a set of attributes—it links with the JAR from Weka. Weka is the machine learning tool which I am using. Thank you.
     
    Last edited: Jun 13, 2020
  2. I know this isn't exactly what you're asking for, but before you get into the weeds of coding something, have you looked at pre-made solutions like the walk-forward optimization in multicharts (https://www.multicharts.com/features/walk-forward/)? It borrows from standard machine learning approaches (test sets, validation sets), and might be able to do what you're looking for, just taking a different route there.

    If that doesn't suit you, how big is your historical dataset? My guess is that tensorflow would let you do what you're looking for if your training set is sufficiently large.
     
  3. user1

    user1

    Thank you for reply zoned_post_meridiem. Correct; not what I am looking for. No pre-made solutions please because others' solutions wouldn't be my solution, wouldn't reflect my strategy. I have in past tried pre-made solutions and found them confining in only able to work within bounds set by others. On other hand getting down to the "weeds of coding" in Java offers unbounded flexibility and freedom limited only by your knowledge of what you want to code. The coding aspect, although challenging, is not insurmountable. However, my question now is seeking general outline of the data science/ML/DL/NN approach. If possible, please elaborate specifics on tensorflow.

    Historical dataset can be as big you want it, as big as your broker allows you to download data. Simply download whatever size timeseries historical data, run your strategy on it, and use it to train your system.
     
  4. kmiklas

    kmiklas

    zenlot likes this.
  5. traider

    traider

    Before you even get into the ML part, ask yourself if your inputs is capable of predicting the output. If you feed the algo garbage you just overfit garbage.
     
  6. Girija

    Girija

    LSTM
     
  7. Snuskpelle

    Snuskpelle

    Java has a couple of decent ML libs actually and for a long time stronger than C# (owing from Java being very popular in academia for a long time). I think he will manage to do what he wants to do in Java. For someone starting out fresh Python would probably be a better choice, though.
     
    kmiklas likes this.
  8. zenlot

    zenlot

    Talking only about AI/ML/DL... Python has taken over. It's not for starting out, it's for complete solution. I am talking here about this particular space, not anything else, where C# and Java shines.
    AI/ML/DL... - Python
    Trading systems, execution... - C++, C#
    Kernel development - C
    Distributed systems - Go
    Porn - Java

    Plenty of other use cases and languages. You have to pick a language which suits the task best.
     
    kmiklas likes this.
  9. arbitech

    arbitech

    GARBAGE IN GARBAGE OUT!

    Dude, I am gone to make you saving a lot of time..

    If you are able to find the good features, inputs, you ou even will not need ml!

    I spent last year on ml... it’s just a piece of shit...
    From dqn to lstm...
    Majority of quant articles are just charlatans....except maybe for microstructure alpha... but with the bid ask don’t even think to try to catch this alpha.


    All things Being equals.. on less than 2-3 minutes it’s possible to forecast price variation with around 70pc accuracy and a bit moore...just with linear statistics. Of course you can add your so loved ml, but it will just be like the cherry on the cake.

    i am à java Guy, but i switched to python for ml... dev is much much Moore faster despite python being an awful language...

    my biggest deception is may be on deep reinforcement learning...despite looking promising...

    that being said, if someone has found something working on ml for tf above 30 minutes... please let me know...
     
  10. Snuskpelle

    Snuskpelle

    You misunderstood "starting out". When you have no existing codebase, the choice is easy: Pick Python (or maybe R if you're a statistician or data scientist).

    However, he's already on a Java codebase. There's Weka (which he's using), deeplearning4j, etc. Unless he's looking for some particular functionality he's unable to implement himself if it's missing he can get by.

    As for Java "being for porn", lol... The JVM is a very mature runtime system and regarding GC I would pick it instead of .NET for some types of demanding backend applications.

    Anyway, @arbitech makes a good point. Usually, it comes down to having data (features) that actually have predictiveness. You can then apply comparatively simple algorithms. That it would suddenly appear a novel algorithm written in Python that revolutionizes trading, and where time lag to Java implementation becomes a problem, is simply not that likely.
     
    Last edited: Jun 14, 2020
    #10     Jun 14, 2020