Programming a price action trading BOT

Discussion in 'Automated Trading' started by TimtheEnchanter, Oct 18, 2020.

  1. RedDuke

    RedDuke

    very true.
     
    #11     Oct 18, 2020
  2. Millionaire

    Millionaire

    You don't need OOP to write a simple trading algo.

    My trading algo has no inheritance or polymorphism even though i am an expert OOP Java programmer.

    There really is not much need for it with a code base that is less than 5,000 lines.
     
    #12     Oct 18, 2020
    rb7 likes this.
  3. userque

    userque

    I actually said you don't need OOP ... in a 'round about way.

    Regardless the size of the program, you can utilize classes to store data, or you can have multiple arrays/lists/etc all over the place--for example.

    OOP was designed to improve programming situations that functional programming could not; but the use of OOP can be avoid to a large extent.

    OOP can be beneficial, regardless the size of the program.
     
    #13     Oct 18, 2020
    d08 likes this.
  4. Snuskpelle

    Snuskpelle

    On topic:

    The way I tend to logically organize the purposes of a bot/trading program/automated strategy/whatever.
    • Alpha/edge
    • Everything else
    Alpha is incredibly difficult to come by since it does not readily hide in magic price patterns in such quantities most trading communities would have you believe. The "easily code trading bot now!!!" tutorials online tend to miss this fact.

    Everything else is usually (comparatively) straightforward to implement and I would go as far as guessing it's always beneficial for discretionary traders to automate the non-alpha parts of their decision process, risk management included.

    Off topic:

    Agreed. I should say though that OOP as taught to novice programmers can induce over-design where zealous adherence to design patterns introduce more complexity than they help managing. The point presumably being to force new programmers to learn these patterns. An experienced programmer knows when s/he should and shouldn't add more abstractions.

    I certainly pull OOP classes in from external libraries (the standard lib included) even when I'm not writing overly OOP code. Large code bases are generally easier to navigate and reason about when organized with OOP. A good nightmare example being poorly organized large C codebases (the best ones tend to use OOP despite that language not explicitly supporting it).
     
    #14     Oct 18, 2020
    ValeryN and Asterix like this.
  5. userque

    userque

    We agree.

    I'll restate for clarity; imo's:

    Functional programmers tend to have more difficulty wrapping their minds around OOP, compared to a new programmer that has never learned functional programming.

    Functional programmers tend to avoid using even minimal OOP (user defined classes), even while using an OOP language, at first.
     
    #15     Oct 18, 2020
  6. Like what? C++? Python is widely used for AI and algo programming. The OOP aspect is not the issue and but I can manage it.
     
    #16     Oct 18, 2020
  7. Millionaire

    Millionaire

    I use Java. But python is fine i was only half joking about the weak typing. If you are careful it shouldnt be an issue. But with Java and even C++ you get more compile time checking.
     
    Last edited: Oct 18, 2020
    #17     Oct 18, 2020
    TimtheEnchanter likes this.
  8. userque

    userque

    Have you considered platforms like Ninjatrader (C#) or Motivewave (Java)?
     
    #18     Oct 18, 2020
    TimtheEnchanter likes this.
  9. SunTrader

    SunTrader

    IMO using a bot when a trader can't control their emotions is .... just another crutch that I believe will not help the underlying issue.
     
    #19     Oct 18, 2020
  10. Trend bars 2k every day on the NQ NQ 12-20 ( RJay's  ChannelTrend 2.0 Bars  60 Tick) 2020_10_13 (7_16_21 AM).png
     
    #20     Oct 18, 2020