NexusFi: Find Your Edge


Home Menu

 





Artificial Intelligence (AI) inside NinjaTrader strategies


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one Big Mike with 6 posts (0 thanks)
    2. looks_two sefstrat with 5 posts (0 thanks)
    3. looks_3 wh with 4 posts (0 thanks)
    4. looks_4 turbolover with 3 posts (1 thanks)
    1. trending_up 23,318 views
    2. thumb_up 13 thanks given
    3. group 19 followers
    1. forum 32 posts
    2. attach_file 2 attachments




 
Search this Thread

Artificial Intelligence (AI) inside NinjaTrader strategies

  #1 (permalink)
 
Big Mike's Avatar
 Big Mike 
Manta, Ecuador
Site Administrator
Developer
Swing Trader
 
Experience: Advanced
Platform: Custom solution
Broker: IBKR
Trading: Stocks & Futures
Frequency: Every few days
Duration: Weeks
Posts: 50,399 since Jun 2009
Thanks Given: 33,175
Thanks Received: 101,541

I'd like some input from the community on how you would add some basic AI (artificial intelligence) principles to your automated trading strategies.

In the past, I've tried assigning weights to certain conditionals, and then take a total score and make entry decisions, even profit target or stop loss decisions, based on the total score -- which was determined by the weight of those conditionals.

It didn't work very well.

What I am trying to do is is add some basic problem solving to a strategy.

Problems to solve:
- Are we in chop?
- Is this normal trading behavior or abnormal?
- Are we bullish or bearish?
- How have our past trades worked, what adjustments are needed?

I think these are some key areas that a human will identify and answer prior to trades, and I want a better method to do this by automation.

However, I don't want strict rules (EMA 100 rising, Stochastic 14,3 below 80, etc). I want fluid rules (the strategy fluidly adjusts each parameter).

In addition, I want the strategy to analyze its past trades and learn from them. Just like a human, but without the emotion. For instance, were we getting stopped to the tick? Were we getting faked out? Were we getting in too early, or exiting too late? etc. A human can make these decisions by glancing at a chart, I want the AI to do the same thing and at least be mostly right.

So like I've said, I've tried some of this before but it didn't work. I want to elevate it and try a new direction, hence my approaching you guys for some help and inspiration.

Any ideas?

Mike

We're here to help: just ask the community or contact our Help Desk

Quick Links: Change your Username or Register as a Vendor
Searching for trading reviews? Review this list
Lifetime Elite Membership: Sign-up for only $149 USD
Exclusive money saving offers from our Site Sponsors: Browse Offers
Report problems with the site: Using the NexusFi changelog thread
Follow me on Twitter Visit my NexusFi Trade Journal Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
Build trailing stop for micro index(s)
Psychology and Money Management
Online prop firm The Funded Trader (TFT) going under?
Traders Hideout
New Micros: Ultra 10-Year & Ultra T-Bond -- Live Now
Treasury Notes and Bonds
Deepmoney LLM
Elite Quantitative GenAI/LLM
 
  #2 (permalink)
 
Big Mike's Avatar
 Big Mike 
Manta, Ecuador
Site Administrator
Developer
Swing Trader
 
Experience: Advanced
Platform: Custom solution
Broker: IBKR
Trading: Stocks & Futures
Frequency: Every few days
Duration: Weeks
Posts: 50,399 since Jun 2009
Thanks Given: 33,175
Thanks Received: 101,541

BTW,

One motivating reason I think this is entirely possible is Video Games. Look at today's video games. I don't play shooters much, but I know that the AI in these games has improved drastically in the last ten years.

The computer-AI can now take cover behind objects, can decide when it needs to retreat or attack, can know if you are near death and alter his attack strategy, can talk to other computer-AI team mates and formulate a joint strategy, and much more.

And it can do it with a lot of realism, so much so that the best games with the best AI can hold their own with some human players. By realism I mean that they can don't take cover behind a weed, but a wall. Or that they know that the player with higher ground has the advantage. etc, etc.

Sure, there is no substitute for human, but I'm not looking for perfection -- I'm only looking for better than average.

Mike

We're here to help: just ask the community or contact our Help Desk

Quick Links: Change your Username or Register as a Vendor
Searching for trading reviews? Review this list
Lifetime Elite Membership: Sign-up for only $149 USD
Exclusive money saving offers from our Site Sponsors: Browse Offers
Report problems with the site: Using the NexusFi changelog thread
Follow me on Twitter Visit my NexusFi Trade Journal Started this thread Reply With Quote
  #3 (permalink)
 
wh's Avatar
 wh 
Neubrandenburg, Germany
 
Experience: Advanced
Platform: R
Trading: Stocks
Posts: 538 since Jun 2009
Thanks Given: 298
Thanks Received: 512


Hi Mike, i agree with your ideas, but i think it requires a quantity to know.
I learn also on AI or better FIS and it gives a lot of solutions for c# or similiar c, java ...
But the problem his, how put the best together ... i am in my research time to develop similar.

You need some steps concept, build, implementation and testing (the most importent point imo) ...

So i do not look in c# or build up, all based now on matlab/R (inspired by sefstrat). You can easy build in matlab ... so your knowledge growing up and and you see what is nonsense and not. Later if i understand all the terms so i build up in c# ...

here some keywords: mackey glass, wavelet, anfis, genfis2, k-step prediction ...
also the unis_report which sefstrat posted is very good. but i also read this doc 7 times, until I have understood ...

best regards

look into the unis_report and in the other paper page 27 - 29 ...

Attached Thumbnails
Artificial Intelligence (AI) inside NinjaTrader strategies-unis_report.pdf   Artificial Intelligence (AI) inside NinjaTrader strategies-jang93anfis.pdf  
Reply With Quote
  #4 (permalink)
 
Big Mike's Avatar
 Big Mike 
Manta, Ecuador
Site Administrator
Developer
Swing Trader
 
Experience: Advanced
Platform: Custom solution
Broker: IBKR
Trading: Stocks & Futures
Frequency: Every few days
Duration: Weeks
Posts: 50,399 since Jun 2009
Thanks Given: 33,175
Thanks Received: 101,541

Hmm. This is where my eyes roll back into my head a bit. I enjoy programming. Lots of languages, many years of experience. But when you start talking math equations, my head explodes.

Can't there be a non-calculus way to do AI? please? lol

Mike

We're here to help: just ask the community or contact our Help Desk

Quick Links: Change your Username or Register as a Vendor
Searching for trading reviews? Review this list
Lifetime Elite Membership: Sign-up for only $149 USD
Exclusive money saving offers from our Site Sponsors: Browse Offers
Report problems with the site: Using the NexusFi changelog thread
Follow me on Twitter Visit my NexusFi Trade Journal Started this thread Reply With Quote
  #5 (permalink)
 
sefstrat's Avatar
 sefstrat 
Austin, TX
 
Experience: Advanced
Platform: NT/Matlab
Broker: Interactive Brokers
Trading: FX majors
Posts: 285 since Jun 2009
Thanks Given: 20
Thanks Received: 768

Honestly you don't really have to understand much of the math to be able to implement most of the techniques.

I would start with fuzzy logic actually, it is very simple mathematically.. the prime reason fuzzy logic was created is to 'keep the man in the loop' and easily allow non-mathematically inclined experts to create rulesets for machine learning tasks.

That is why fuzzy logic is often combined with genetic algorithms or neural nets, it gives a structured framework which makes it much easier to define rulesets which is usually the hardest part of designing a machine learning system.

As wh mentions Matlab is very valuable for this line of research.. one of the best things about it is that you can easily prototype your ideas and you don't really have to know much about the math because all of the hard work is done for you (because there are many good demo programs of AI and related techniques in matlab, much more so than c# or any other language). The matlab scripting language is very similar to c but is interpreted like ruby or python so you can instantly try things out and it is easy to understand if you know c#.. plus the built in documentation is very good, lightyears ahead of visual studio

So after learning the basics of matlab you can relatively easily translate complicated AI programs into c# without fully understanding the details of what is going on. You can use the demos in matlab to understand the general idea of how a technique works in a graphical way, in most cases that level of understanding is all that is required.

I think if you do that also you will find that many of the techniques are not as complicated as you might think, in most cases its just all the mathematical jargon which makes them look very complicated. Its somewhat analogous to how lawyers speak in legalese just to keep themselves relevant although the subjects they discuss are really not fundamentally complex.

Reply With Quote
  #6 (permalink)
 
Big Mike's Avatar
 Big Mike 
Manta, Ecuador
Site Administrator
Developer
Swing Trader
 
Experience: Advanced
Platform: Custom solution
Broker: IBKR
Trading: Stocks & Futures
Frequency: Every few days
Duration: Weeks
Posts: 50,399 since Jun 2009
Thanks Given: 33,175
Thanks Received: 101,541

Alright, I guess it's time to dig up my friends copy of Matlab...

Mike

We're here to help: just ask the community or contact our Help Desk

Quick Links: Change your Username or Register as a Vendor
Searching for trading reviews? Review this list
Lifetime Elite Membership: Sign-up for only $149 USD
Exclusive money saving offers from our Site Sponsors: Browse Offers
Report problems with the site: Using the NexusFi changelog thread
Follow me on Twitter Visit my NexusFi Trade Journal Started this thread Reply With Quote
  #7 (permalink)
 MXASJ 
Asia
 
Experience: Beginner
Platform: NinjaTrader, TOS
Posts: 796 since Jun 2009
Thanks Given: 109
Thanks Received: 800


Big Mike View Post
Alright, I guess it's time to dig up my friends copy of Matlab...

Mike

The "Real Deal" Matlab with the extra packages you need is actually pretty dear. US$ for what I'd want is roughly 6.5K. Where I live it's about $10K.

With that, consider R. It is not as intuitive or pretty, but it's free. REvolution offers a nice package for Windows users (sorry), and RMetrics offers a companion package. Look at the Matlb vs. R vs. C++ textbook availability for finance on Amazon.

I've never really been an open source guy but now that it's my money and not the Company's, my trading rig includes uses Open Office and R... no Office in sight .

Give me a year and I'll have Ninja calling R (or is it the other way around? ).

Reply With Quote
  #8 (permalink)
 
sefstrat's Avatar
 sefstrat 
Austin, TX
 
Experience: Advanced
Platform: NT/Matlab
Broker: Interactive Brokers
Trading: FX majors
Posts: 285 since Jun 2009
Thanks Given: 20
Thanks Received: 768

I think $6500 sounds like overkill, I seriously doubt you need that many of the toolboxes. While the matlab toolboxes are very nice you can get free replacements for pretty much anything they can do in the matlab repository or elsewhere on the web. The reason the official toolboxes are worthwhile IMO is their excellent documentation which features real world examples and often interactive demos all with very clean and well documented code.

Many of the free matlab packages have good demos and examples as well but most of the time their code is not very well documented and is much harder to follow, especially if you are not very familiar with matlab or the math behind the technique in question.

R is nice too (can't argue with free) and they have pretty good documentation for an open source project but it can't compete with Matlab as far as ease of use. I think it would be safe to say matlab has the best integrated help I have ever seen in a product, very clear well formatted documentation (no tangled nightmare of crap like microsoft docs ie MSDN), lots of video demos included, informative application specific webcasts available on their website etc etc..

Reply With Quote
  #9 (permalink)
 gio5959 
Chiron
 
Experience: None
Platform: ninjatrader
Broker: Amp Futures/Zen-Fire
Trading: ES
Posts: 737 since Aug 2009
Thanks Given: 25
Thanks Received: 155

theres some pretty smart ppl that hang around big mike's forum - hope it rubs off on me

Visit my NexusFi Trade Journal Reply With Quote
  #10 (permalink)
 
shodson's Avatar
 shodson 
OC, California, USA
Quantoholic
 
Experience: Advanced
Platform: IB/TWS, NinjaTrader, ToS
Broker: IB, ToS, Kinetick
Trading: stocks, options, futures, VIX
Posts: 1,976 since Jun 2009
Thanks Given: 533
Thanks Received: 3,709


I heard one interview on TraderInterviews.com of a trader that uses Neuroshell and says it gives them an edge. He keeps buying more computers so he can run more instances of Neuroshell. These guys always run ads in TASC too and they've been around a while. I've never used their tools so I can't speak to their effectiveness.

Follow me on Twitter Visit my NexusFi Trade Journal Reply With Quote




Last Updated on August 25, 2014


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts