Glitch8
 ( 11.27% )
- ago
https://www.wealth-lab.com/extension/detail/NeuroLab

You can post your rave reviews and praise below!!
3
2,105
24 Replies

Reply

Bookmark

Sort
Cone8
 ( 4.92% )
- ago
#1
Awesome effort Glitch!
You just put the complexity of Neural Networks within the grasp of anyone who can drag and drop on a Windows computer - and of course who subscribes to Wealth-Lab 7!
0
- ago
#2
Great!

It's working!))

I like the pipeline - easy and smoth. Like your blocks strategies instead of coding, NeuroLab is an easy way of doing ML.

I am to find out is it flexible enaugh for hardcore ML and at the same time if hardocore ML is needed for effective trading).

Great job! No exception were met)).

P.S. Training curves for dogs and cats will look like this, but my experiance tells me that for trading OOS curve looks a little different, so... may be some data leaking take place.


0
- ago
#3
Question: What does the "Prune" button do? I could not find a description in the Help file?

Vince
0
Glitch8
 ( 11.27% )
- ago
#4
Prune removes the first few data points from the graphs. I don’t think there is any leaking, this is largely a wrapper for SharpLearning, but will take a second look.
0
- ago
#5
Thanks!

Vince
0
- ago
#6
QUOTE:
P.S. Training curves for dogs and cats will look like this, but my experiance tells me that for trading OOS curve looks a little different, so... may be some data leaking take place.


After a small research.

It happend only with single layer with two neurons. If I add neurons – something like 100 – the learning curves start looking normal. So the only suggestion is to increase baseline model neurons count to prevent users questions).
1
Glitch8
 ( 11.27% )
- ago
#7
Makes sense, open to suggestions on a good number of starting neurons for the Baseline hidden layer.
0
- ago
#8
Glitch,

I suggest that as a baseline consider 5-8 neurons. Knowledgeable people will move on from there.

Vince
1
- ago
#9
Glitch,

I would also suggest that the default values for L1/L2 regularization be some small value, and not zero. People who are not familiar with regularization might not make it non-zero through lack of familiarity, and that would be a mistake.

Vince
1
Glitch8
 ( 11.27% )
- ago
#10
What do you think the ideal L1/2 defaults should be?
0
- ago
#11
Glitch,

Something in the range of 0.001 to 0.01 would be a good starting point for most users.

Vince
1
- ago
#12
Fantastic work Glitch, as always!
0
- ago
#13
All my NNs I've tried in NeuroLab by this moment are just drawing the copy of price chart), it’s not the problem of the NeuroLab of course... btw any ideas of what I am doing wrong?)

Did you think of adding classification, not only regression task (maybe I can do it now, but don’t know how), like long/short. But… maybe it’s not a way out for this because NN can learn to always buy as it now learns to predict zero change for regression task.
0
Cone8
 ( 4.92% )
- ago
#14
I've noticed the "follows-the-chart" phenomenon when using Relu activation, and have seen more reasonable results with Sigmoid. I don't have any more insight about it at this point.
1
- ago
#15
QUOTE:
I've noticed the "follows-the-chart" phenomenon when using Relu activation, and have seen more reasonable results with Sigmoid. I don't have any more insight about it at this point.


Thanks!
0
- ago
#16
Clicking "New", then "Cancel" yields an exception...

#BugReport #NeuroLab
1
- ago
#17
Thanks Len, fixed for Build 2.
0
- ago
#18
Is it possible to use the C# Coded as a starting point for NeuroLab strategy. I have one indicator that I need to build in code.
0
Cone8
 ( 4.92% )
- ago
#19
Sure. You can use the NNP indicator [almost] like any other indicator. I say "almost" because it doesn't currently have a Series method. Example -

CODE:
using WealthLab.NeuroLab; // add this at the top IndicatorBase myNNSeries = new NeuralNetPredictor(bars, "pcatNetwork");
0
- ago
#20
How are cross-overs handled for 2 indicators.
0
- ago
#21
An example of of using NeuroLab would be very useful.
0
- ago
#22
Here's a strategy that uses NeuralNetPredictor...


CODE:
using System; using WealthLab.Backtest; using WealthLab.Core; using WealthLab.Indicators; using System.Drawing; using WealthLab.NeuroLab; namespace WealthScript1 {    public class NN_WL7_Simple : UserStrategyBase    {       public NN_WL7_Simple() : base()       {          AddParameter("(B)Min Price", ParameterTypes.Double, 8, 7.00, 15.00, 0.20);          AddParameter("(B)NN to buy", ParameterTypes.Double, 27.24, 25.0, 36.0, 0.01);          AddParameter("(S)Min Bars", ParameterTypes.Int32, 4, 3, 10, 1);          AddParameter("(S)Up Target %", ParameterTypes.Double, 5.80, 4.0, 10.0, 0.1);          AddParameter("(S)Stop Loss %", ParameterTypes.Double, 9.90, 5.0, 15, 0.1);       }       public override void BacktestBegin()       {          base.BacktestBegin();          BacktestSettings.RetainNSFPositions = false; // OVERRIDES PREFERENCES!!!       }       //create indicators and other objects here, this is executed prior to the main trading loop       // DON'T define variables here that are needed by "Execute"       public override void Initialize(BarHistory bars)       {          NnName = "WL7NN01";          ibaseNN = new NeuralNetPredictor(bars, NnName);          dsNN = ibaseNN; // Cast to a TimeSeries - Is this necessary?          PlotTimeSeries(dsNN, NnName, "NN"); // (TimeSeries)          paramMinPrice = Parameters.FindName("(B)Min Price").AsDouble;          buyNN = Parameters.FindName("(B)NN to buy").AsDouble;          gainFactor = 1.0 + (Parameters.FindName("(S)Up Target %").AsDouble * 0.01);          lossFactor = 1.0 - (Parameters.FindName("(S)Stop Loss %").AsDouble * 0.01);          paramMinBars = Parameters.FindName("(S)Min Bars").AsInt;       }       //execute the strategy rules here, this is executed once for each bar in the backtest history       public override void Execute(BarHistory bars, int bar)       {          if (bar < 50) return;          if (!HasOpenPosition(bars, PositionType.Long))          {             //code your buy conditions here             if (dsNN[bar] > buyNN && bars.Close[bar] >= paramMinPrice) // High enough NN score and price             {                myTran = PlaceTrade(bars, TransactionType.Buy, OrderType.Market, 0);                Double dblWt = Math.Round(dsNN[bar], 5);                myTran.Weight = dblWt;                myTran.Tag = dblWt.ToString();                myTran.SignalName = "Buy";                DrawBarAnnotation("B", bar + 1, true, Color.Black, 14);                takeGain = bars.Close[bar] * gainFactor;                stopLoss = bars.Close[bar] * lossFactor;             }          }          else          {             //code your sell conditions here             Position p = LastPosition;             takeGain = p.EntryPrice * gainFactor;             stopLoss = p.EntryPrice * lossFactor;             if ((bar - p.EntryBar) >= paramMinBars) // Give it a few bars             {                if (bars.Close[bar] > takeGain) // Take profit if above Up Target                {                   myTran = PlaceTrade(bars, TransactionType.Sell, OrderType.Market, 0);                   myTran.SignalName = "Gn";                   DrawBarAnnotation("Gn", bar +1, false, Color.Black, 14);                }                else if (bars.Close[bar] < stopLoss) // Take the loss if below Stop Loss limit                {                   myTran = PlaceTrade(bars, TransactionType.Sell, OrderType.Market, 0);                   myTran.SignalName = "SL";                   DrawBarAnnotation("SL", bar +1, false, Color.Black, 14);                }             }          }       }       //declare private variables below       string NnName;       IndicatorBase ibaseNN;       TimeSeries dsNN;       Transaction myTran;       Double buyNN;       Double paramMinPrice;       double takeGain;       double stopLoss;       double gainFactor;       double lossFactor;       int paramMinBars;    } }
0
- ago
#23
First of all – I like the whole idea of NeuroLab. But second, I don’t use NeuroLab.

Here is some ideas on NeuroLab, so it could be more useful and powerful, at least for me). Your feedback much appreciated.

How I do it. I do not vectorize everything explicitly when making my strategies, I use iteration as well as timeseries. But I have built-in serialization logic (in my wrapping library). I use it mainly when developing and evaluating a strategy. So even if my condition looks like: if falling peaks e.g. – it will be vectorize (TimeSeries as a result). So my strategy produces timeseries. I didn’t interact much with NeuroLab, but I think it deals with Indicators only? So what I need first is to be able to use TimeSeries… withing the strategy maybe (somehow). What is the difference – the efforts needed to create one. Indicator is something you have to create with a special class and it takes much efforts, TimeSeries is something you can create easily.

And the second thing I need is… boosting algorithm in-place. Don’t get me wrong, neural networks are great, at least at classifying cats and dogs and self-driving cars and stuff like that. But when dealing with table data all you need is boosting – XGBoost, CatBoost etc, nothing is more powerful yet simple when dealing with table data than boosting.

What I do now (moving this way) – I encode those TimeSeries in trades (using Tag). Then I use Positions and get feature out of tags, then I use boosting in my Python script. And the main problem in all this is… trading… I can evaluate a strategy using this, but I will have many problems when trying to trade using this – technical problems because I’ll need to add a new ML “layer” above WL7 signals. And when thinking about those technical difficulties I thought that improving the NeuroLab would be a good decision. So please tell me what you think of it).

I hope I was convincing enough to explain why using Timeseries is not the same as using Indicators and using boosting is not the same as using NN (although this one is minor).

Or maybe as always I can do it already but I don’t know about it)).
0
Glitch8
 ( 11.27% )
- ago
#24
The earlier NeuroLab for WL6 did let you use TimeSeries, because you had to write a special script. The trade off is that it made it much more difficult for beginners.

I want to extend NL eventually to allow different kind of input blocks. Right now there is just one kind, Indicators. We can introduce a scripting Input Block, one for the new PriceGrid concept, and maybe even things like Point & Figure.

The sky’s the limit, sounds like this calls for a feature request!
0

Reply

Bookmark

Sort