Java Error, when running a backtest:


java.lang.NullPointerException: Cannot invoke "com.strategyquant.tradinglib.IBlock.evaluateBlock(int)" because "this.Indicator" is null

DATA:

MetaTrader5 (hedged), USA500IDXUSD_dukascopy, M15, 2015.01.01 - 2025.05.26

Spread: 460, Slippage: 0

Commission: $ 0.00 per full lot, Swap: -979.17/396.54 points per day

MONEY MANAGEMENT:

Initial Capital: $10000, RiskFixedBalancePct, Risk: 1, Decimals: 1, LotsIfNoMM: 1, MaxLots: 50

TRADING OPTIONS:

ExitAtEndOfDay: false

EODExitTime: 23:55

ExitOnFriday: false

FridayExitTime: 23:00

MarketOpenSession: No Session

PSEUDO CODE:

#Strategy Name = US500_RSI2_Long_Improved Type = MetaTrader4 Symbol = US500 Timeframe = M15

#StrategyCharts Main chart = US500 / M15

#MoneyManagement Method = Fixed size, 0.1 lots Initial Capital = 10000

#Variables

#Signals LongEntrySignal = MABarClosesAbove(Simple,Close,200)[1] AND RSI(Close,2)[1] < 15 AND ATR(14)[1] < IndicatorHighest(0,50,ATR(14)[1]) ShortEntrySignal = False LongExitSignal = RSI(Close,2)[1] > 60 ShortExitSignal = False

#Long entry [If-Then, OnBarUpdate, OnBarOpen] -------------

#If Condition = LongEntrySignal AND NOT ShortEntrySignal

#Then #EnterAtMarket Direction = Long Size = 0.1 MagicNumber = 11111 Profit Target = 4xATR(14) Stop Loss = 3xATR(14)

#Long exit [If-Then, OnBarUpdate, OnBarOpen] -------------

#If Condition = LongExitSignal AND NOT LongEntrySignal

#Then #ClosePosition Direction = Long Symbol = Current MagicNumber = 11111

#Description Long-only improved mean reversion for US500 M15: Buy if price is above 200-SMA, RSI(2) < 15, and ATR(14) is below its recent high (limits exposure to calmer periods). Exit when RSI(2) > 60. Fixed 0.1 lot size, PT=4xATR(14), SL=3xATR(14). No shorts; trend and volatility filters slow overtrading. Mode = CreateMode

Please authenticate to join the conversation.

Upvoters
Status

In Review

Board

AI Demo

Date

7 months ago

Author

ottigermichael

Subscribe to post

Get notified by email when there are changes.