NexusFi: Find Your Edge


Home Menu

 





The Evolution Of NN with C#


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one wh with 10 posts (9 thanks)
    2. looks_two sefstrat with 7 posts (14 thanks)
    3. looks_3 Big Mike with 3 posts (0 thanks)
    4. looks_4 MXASJ with 2 posts (0 thanks)
    1. trending_up 27,087 views
    2. thumb_up 26 thanks given
    3. group 20 followers
    1. forum 31 posts
    2. attach_file 2 attachments




 
Search this Thread

The Evolution Of NN with C#

  #21 (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 know some of you guys are using AForge, they released 2.0 final version today so you might want to check that out =)

aforge - Project Hosting on Google Code

Reply With Quote
Thanked by:

Can you help answer these questions
from other members on NexusFi?
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
ZombieSqueeze
Platforms and Indicators
Trade idea based off three indicators.
Traders Hideout
Pivot Indicator like the old SwingTemp by Big Mike
NinjaTrader
REcommedations for programming help
Sierra Chart
 
  #22 (permalink)
 
wh's Avatar
 wh 
Neubrandenburg, Germany
 
Experience: Advanced
Platform: R
Trading: Stocks
Posts: 538 since Jun 2009
Thanks Given: 298
Thanks Received: 512

Quantlib for C# == QLNet

QLNet | Get QLNet at SourceForge.net

Started this thread Reply With Quote
Thanked by:
  #23 (permalink)
 
caprica's Avatar
 caprica 
USA
 
Experience: Master
Platform: NinjaTrader
Posts: 155 since Jul 2009
Thanks Given: 45
Thanks Received: 114


does anyone have sample code on how you are using this in ninja?

"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain

Reply With Quote
  #24 (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 sefstrat,

your input for building your system came from forex-tsd like Better NN EA development - Forex Trading

Started this thread Reply With Quote
  #25 (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


wh View Post
hi sefstrat,

your input for building your system came from forex-tsd like Better NN EA development - Forex Trading

Not really, I have looked through that thread before a little bit.. a few good links but mostly just people throwing around ideas. I did find the cupsbook.pdf on that thread I believe which has some good examples of how to use a'trous wavelet technique (which is used on one of the inputs of my NN).

The NN part of my system is primarily based on the book I linked to earlier in this thread (NN control of nonlinear discrete time systems). It is a recurrent, closed-loop network.. meaning no offline training, all training is performed online in real time via convex optimization routines. Therefore it is inherently adaptive and not subject to many of the problems associated with supervised learning such as over-fitting, poor choice of sample data, etc..

Closed loop network is more difficult to implement and has its own set of challenges but in general they are explicit rather than implicit (implied from training data) so you can more easily control its mechanism of adaption and tune it the way you want.

Reply With Quote
Thanked by:
  #26 (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,469 since Jun 2009
Thanks Given: 33,247
Thanks Received: 101,669


wh View Post
For three weeks, I have communicated with neural networks and genetic coding.
Have heard about this for years, but ... nothing for me. Now the circle is closed.
As a seasoned Googler, I found this AForge.NET :: Computer Vision, Artificial Intelligence, Robotics Framework, which has beautiful examples of application. What important is for the learning process. See links below.

Last week i order a book by amazon: Introduction to Neural Networks for C#, 2nd Edition (Perfect Paperback)


Why i wrote this:

if(ninjatrader == c# && Afroge == c#)
bool isGood = true;

you can implement classes to your ninjascript or build external programms that you can connect. An other importent reason is: Aforge is open source and this is good. Free world, free sources and free money ...


Some good links for learning and understanding are:
CodeProject: Genetic Algorithm Library. Free source code and programming help
CodeProject: Evolution computations on C#. Free source code and programming help
CodeProject: AI : Neural Network for beginners (Part 1 of 3). Free source code and programming help
CodeProject: Neural Networks on C#. Free source code and programming help

The examples works well, and you can use your data for testing.
Create small indicator how write your close[i] or ma[i] or something else to a csv and then import csv to examples.

Arne

Hi wh,

I was thinking of toying with this again. I was wondering if you have a very basic NT framework for aforge you would share with me (just based on Close[0] is fine or whatever you have).

Mike



Join the free Markets Chat beta: one platform, all the trade rooms!

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 Reply With Quote
  #27 (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 here the samples from https://www.codeproject.com/. For more info go in and search on this site "Neural Network". There are a lot of good examples.


for data input i use a simple loop and copy & paste from output window in a file, but you can also generate auto a csv script. but i am fool. here a dirt sample.
 
Code
                            
if(CurrentBar 48) return;
            
            
double[] _close = new double[48];
            
            for(
int i 0_close.Lengthma1.Lengthi++)
            {
                
_close[i] = Close[j];
                
                Print(
_close[i]);
                
j--;
                
            }
            Print(
""); 
Also go here in

Attached Files
Elite Membership required to download: neuro_demo.zip
Elite Membership required to download: neuro_src.zip
Started this thread Reply With Quote
Thanked by:
  #28 (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,469 since Jun 2009
Thanks Given: 33,247
Thanks Received: 101,669


wh View Post
hi mike here the samples from https://www.codeproject.com/. For more info go in and search on this site "Neural Network". There are a lot of good examples.


for data input i use a simple loop and copy & paste from output window in a file, but you can also generate auto a csv script. but i am fool. here a dirt sample.
 
Code
                            
if(CurrentBar 48) return;
            
            
double[] _close = new double[48];
            
            for(
int i 0_close.Lengthma1.Lengthi++)
            {
                
_close[i] = Close[j];
                
                Print(
_close[i]);
                
j--;
                
            }
            Print(
""); 
Also go here in

Thanks Arne

Mike



Join the free Markets Chat beta: one platform, all the trade rooms!

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 Reply With Quote
  #29 (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,469 since Jun 2009
Thanks Given: 33,247
Thanks Received: 101,669


wh View Post
hi mike here the samples from https://www.codeproject.com/. For more info go in and search on this site "Neural Network". There are a lot of good examples.


for data input i use a simple loop and copy & paste from output window in a file, but you can also generate auto a csv script. but i am fool. here a dirt sample.
 
Code
                            
if(CurrentBar 48) return;
            
            
double[] _close = new double[48];
            
            for(
int i 0_close.Lengthma1.Lengthi++)
            {
                
_close[i] = Close[j];
                
                Print(
_close[i]);
                
j--;
                
            }
            Print(
""); 
Also go here in

Ok, I was hoping someone had actually integrated it with Ninja already (no copy/paste). I was looking to feed it a series of variables and values and get back a prediction for a certain series.

Mike



Join the free Markets Chat beta: one platform, all the trade rooms!

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 Reply With Quote
  #30 (permalink)
scJohn
Rock HIll, SC
 
Posts: 2 since Jul 2009
Thanks Given: 0
Thanks Received: 1


I am looking at SVM (Support Vector Machines). Specifically as implemented at
https://www.csie.ntu.edu.tw/~cjlin/libsvm/

I am trying out the C# version located at
Matthew Alastair Johnson - SVM.NET

SVM seems primarily for classification systems but it can also be used for regression. My initial impressions after getting a C# console version up and running is that real time training is not feasible. The training will have to be done offline in the background. There are sufficient methods in the C# implementation that real time predictions will be an easy implementation in Ninja from a model that is generated offline.

Instead of wavelets, look at SVD (Singular Value Decomposition). A C# implementation can be found at
Singular value decomposition - ALGLIB

I have run the test console version and I feel that this is something that can be done in real time. The only problem is that what is provided at the above link converts your input into an SVD representation. There is no code showing how to take this SVD internalization to produce output. This should not be a big problem but I do not have the math skills to determine the code to reverse the SVD back into the real world. Maybe there is someone out there who can do this. Should be similar to PCA.

Reply With Quote




Last Updated on September 23, 2009


© 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