Programming a price action trading BOT

Going from 20 years of functional programming to OOP is not as easy as some make it sound.

IMO, a non-programmer can pick up OOP more quickly than a pro functional programmer.

Of course, once the pro catches-on, s/he will eventually surpass the non-programmer's capabilities.

EDIT:

The old school pro will tend to avoid OOP as much as possible. Essentially using that OOP language as though it were a purely functional language--to the extent possible.

very true.
 
Going from 20 years of functional programming to OOP is not as easy as some make it sound.

IMO, a non-programmer can pick up OOP more quickly than a pro functional programmer.

Of course, once the pro catches-on, s/he will eventually surpass the non-programmer's capabilities.

EDIT:

The old school pro will tend to avoid OOP as much as possible. Essentially using that OOP language as though it were a purely functional language--to the extent possible.

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.
 
  • Like
Reactions: rb7
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.
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.
 
  • Like
Reactions: d08
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.

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.

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).
 
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).

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.
 
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.

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:
This is not going to be easy, but I have all the time in the world and if I do not do this, I just piss my money away scalping for ticks. My problem in trading is emotional more than picking the right trades. I quit trades too quickly, then second guess myself, I suppose these problems can occur with a well "trained" bot, as one can override trades but that is also a situation that can be programmed with stops. The gambler mentality is to do something, constant biofeedback, akin to endorphins by getting an IM on the iPhone. I am 64 and I used to be a mainframe Assembler/ Unix C programmer for nearly 20-years. I am taking an Udemy class on python and IB API's, a little dated course for $49. The instructor is Indian and he has done a lot of these courses for Oanda API etc. I have downloaded Anaconda as well. Looking at the language is not the hard part. Programming price action will be the challenge. I will distill the best buy sell setups not using anything but prior highs and lows with determination is we are in a up/down channel, breakout or trading range. Moving average is the only indicator I care to look at. Two types of orders will be used; stop for breakout and limit for trading range.
Have you considered platforms like Ninjatrader (C#) or Motivewave (Java)?
 
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.
 
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
 
Back
Top