IndicatorBlock - null Strategy value

When trying to use other indicators in a custom indicator, the following exception is thrown:



18:31:25.762 [Blocking computeThread #1 - unnamed_0] ERROR c.s.g.c.p.MultithreadComputePerformer - Error while running task: unnamed_0(3514886c-e84d-4ac6-be86-df33150ebebd))
com.strategyquant.datalib.TradingException: null
at SQ.Internal.IndicatorBlock.OnBlockEvaluate(Unknown Source) ~[na:na]
at SQ.Internal.IndicatorBlock.evaluateBlock(Unknown Source) ~[na:na]
at SQ.Blocks.Comparisons.IsGreater.OnEvaluateComparison(IsGreater.java:39) ~[na:na]
at SQ.Internal.ComparisonBlock.evaluateBlock(ComparisonBlock.java:73) ~[na:na]
at SQ.Internal.RulesImpl.Signal.evaluateRule(Signal.java:104) ~[na:na]
at SQ.Internal.StrategyEvent.evaluateEvent(StrategyEvent.java:84) ~[na:na]
at SQ.Internal.XmlStrategy.OnBarUpdate(XmlStrategy.java:198) ~[na:na]

As example:

public class MyFirstCustomIndicator extends IndicatorBlock { 


@Override
protected void OnBarUpdate() throws TradingException {
MovingAverage indicator = Strategy.Indicators.MovingAverage(Input, Period, MAMethod);
                // ...

In above code 'Strategy' itself is null. 

Note, this is a problem for IndicatorBlock. not sure on ConditionBlock.

Same problem in both AlgoWizard and Builder.


Further to https://roadmap.strategyquant.com/tasks/sq4_7201 the logic does not work for IndicatorBlock - please address


Attachments
No attachments
  • Votes +1
  • Project StrategyQuant X
  • Type Bug
  • Status Fixed
  • Priority Normal

History

TT
#1

Tamas

24.11.2020 08:06

Status changed from New to Fixed

Just call Indicators.MovingAverage(Input, Period, MAMethod); without Strategy prefix
f
#2

fm663

24.11.2020 12:27
Thanks Tamas. In signals there are Strategy.Indicators

When to use which one?


Votes: +1

Drop files to upload

or

choose files

Max size: 5MB

Not allowed: exe, msi, application, reg, php, js, htaccess, htpasswd, gitignore

...
Wait please