- ago
I have created a NeuroLab indicator and successfully backtested against ISF. If I then change the strategy to SPX, the NNpredictor doesnt seem to calculate - i.e. if I look at the chart, the NNpredictor window shows a straight line.
0
386
Solved
11 Replies

Reply

Bookmark

Sort
Cone8
 ( 26.65% )
- ago
#1
It's not enough info to even start to imagine what's going on there.
1. Any errors in the Strategy Window or the Log Viewer? (Ctrl+L)
2. Strategy Code? If it's a Block Strategy, export the code and post it.
3. A screenshot of the Neuro-Lab Architecture could help.
2
- ago
#2
Hi @cone
1. No errors from running the strategy
2. Building block strategy. C# code here:
CODE:
using WealthLab.Backtest; using System; using WealthLab.Core; using WealthLab.Data; using WealthLab.Indicators; using System.Collections.Generic; using WealthLab.NeuroLab; namespace WealthScript1 { public class MyStrategy : UserStrategyBase {     public MyStrategy() : base() {          AddParameter("Value", ParameterType.Double, 12, 10, 20, 1);          AddParameter("Value2", ParameterType.Double, 4, 1, 10, 1);          AddParameter("Value1", ParameterType.Double, 10, 0, 10, 1);          AddParameter("Value3", ParameterType.Double, 10, 0, 10, 1); StartIndex = 0; } public override void Initialize(BarHistory bars) {          indicator = new NNPredictor(bars,"New predictor",0);          PlotIndicator(indicator,new WLColor(0,0,0));          indicator2 = new NNPredictor(bars,"New predictor",0);          indicator3 = new NNPredictor(bars,"New predictor",0);          indicator4 = new NNPredictor(bars,"New predictor",0); } public override void Execute(BarHistory bars, int idx) {          int index = idx;          Position foundPosition0 = FindOpenPosition(0);          bool condition0;          if (foundPosition0 == null)          {             condition0 = false;             {                if (indicator[index] > Parameters[0].AsDouble)                {                   condition0 = true;                }             }             if (condition0)             {                _transaction = PlaceTrade(bars, TransactionType.Buy, OrderType.Market, 0, 0, "Buy At Market (1)");             }          }          else          {             condition0 = false;             {                if (indicator2[index] < Parameters[1].AsDouble)                {                   condition0 = true;                }             }             if (condition0)             {                Backtester.CancelationCode = 164;                ClosePosition(foundPosition0, OrderType.Market, 0, "Sell At Market (1)");             }          }          Position foundPosition1 = FindOpenPosition(1);          bool condition1;          if (foundPosition1 == null)          {             condition1 = false;             {                if (indicator3[index] < Parameters[2].AsDouble)                {                   condition1 = true;                }             }             if (condition1)             {                _transaction = PlaceTrade(bars, TransactionType.Short, OrderType.Market, 0, 1, "Short At Market (2)");             }          }          else          {             condition1 = false;             {                if (indicator4[index] > Parameters[3].AsDouble)                {                   condition1 = true;                }             }             if (condition1)             {                Backtester.CancelationCode = 166;                ClosePosition(foundPosition1, OrderType.Market, 0, "Cover At Market (2)");             }          } } public override void NewWFOInterval(BarHistory bars) {          indicator = new NNPredictor(bars,"New predictor",0);          indicator2 = new NNPredictor(bars,"New predictor",0);          indicator3 = new NNPredictor(bars,"New predictor",0);          indicator4 = new NNPredictor(bars,"New predictor",0); }       private IndicatorBase indicator;       private IndicatorBase indicator2;       private IndicatorBase indicator3;       private IndicatorBase indicator4;       private Transaction _transaction; } }

3. Screenshot of Neurolab architecture

0
Cone8
 ( 26.65% )
- ago
#3
QUOTE:
the NNpredictor window shows a straight line.
At what value?
0
- ago
#4
@cone -200.77
0
Cone8
 ( 26.65% )
- ago
#5
Nothing's jumping out at me. Even though you said "a straight line", I was actually expecting a 0 or NaN result for SPX.
What is ISF (the symbol that works) and which Data Provider has it? Maybe there's a clue there.
0
- ago
#6
How about other symbols and data providers?
0
- ago
#7
Hi @cone and @eugene
Thanks for your time on this.
I'm using IBKR as a data provider.
ISF is FTSE100 tracker ETF on the LSE, ISF;STK;GBP;SMART
If I try it on TQQQ, SPXL at 15 minutes both have the same -200.77 value
I thought at first that it was data related and something to do with the exchanges but I tried it on AAPL and get a very negative reading but with spikes when the market is declining. If I look at period of sharp decline in SPXL, there are no spikes so it doesn't seem to be that.
Perhaps in some way its a reflection of the absolute price of the stock - ISF is 700s, and gives results near 10, AAPL is at 140ish and showing negative values with spikes, SPXL is mid 70s and showing just -200.77
It doesn't look like a useable strategy so I'd put investigating this in the low priority bucket.


0
Cone8
 ( 26.65% )
- ago
#8
The [lack of] Pre/Post data may be affecting the indicator. Check "Filter Pre/Post" for the U.S. symbols and I think you'll see something different.
0
- ago
#9
Hi @cone, I ticked pre/post as you suggested and tried SPX, QQQ, TQQQ, SPXL all with the same result.
0
Cone8
 ( 26.65% )
- ago
#10
Probably the only way to explain it is that "it is what it is". You must have trained the NN only on ISF and it created optimized relationships tuned to it. I'm not an expert, but a lot of NNs just need to be trashed - the output isn't meaningful for whatever reason.

It's hard to say, but based on the examples, it's possible that the price range has something to do with it. How does the output look with another series in the $800 range - like ORLY?

0
Best Answer
- ago
#11
Hi @cone,
Yes I thought that too. It seems to be the case. Shows values for ORLY ok.
Case closed.
Thanks for your help.
1

Reply

Bookmark

Sort