Click here to Login

                                                   problem with backtesting ^dji


2018-11-26 18:31:45

i am testing a simple entry moving average for performance and the system will not make any buys after 1/26/1996.
When i isolate the test to the time frame where no trades are made the test gives me the error the "error.OnEndSimulation : Compilation error in 'OnEndSimulation':
Index was outside the bounds of the array."
what could be the problem here? this is hurting my ability to perform accurate tests and there should be trades being made during this time frame.

2018-11-26 18:33:04


my formula for this
// Buy rules
Optimize("op1", 3, 16, 1);
Optimize("op2", 8, 30, 2);
Rule1 = (SMA(op1) > SMA(op2));
buy = (Rule1);
// Sell rules

Optimize("ops0", 5, 20, 5);
SetSimStop(_StopNBar, _Percent, ops0, 1);

2018-11-26 19:33:43


never mind i found that there seems to be an issue with the amount of funds that the program did not like

2018-11-27 02:39:00


The issue is not related to your formula but rather to the money management script you added.
The issue is located in the "OnEndSimulation" event.

No more messages


No html code. URLs turn into links automatically.

Type in the trading objects you want to include: - Add Objects
To add a trading object in your message, type in the object name, select it and then click on "Add Objects"


Trading Items
Short Term Trading System with RSI Ratios
Long Term Up Trend with Short term re-entery Signals
Double / Triple Smoothened EMA with Flexible Alpha
Enhanced Candlestick Chart with Volume Variation
Stocks with an EPS Several Times Higher than the Industry Average...

How-to Lessons
How to screen for stocks having a high correlation with the Dow J...
How to associate an index with a list of stocks
How to create a chart with a black background
How to use QuantShare with Metastock data
How to speed up watchlist and screener plug-ins when working with...

Related Forum Threads
problem with nse data
Problem with "Save Trading System" in Optimizer
Problem with EOD Historical Data for LSE Listed Stocks
Problem with data from Bloomberg
Problem with performance calculation in custom function

Blog Posts
9 mistakes you should avoid when backtesting an end-of-day stock ...
Backtesting Process
How to Backtest an Intraday Stock Trading System with EOD Ranking
Backtesting All Candlestick Patterns in 10 Minutes
Backtesting trading strategies using intraday data

Create an account
Affiliate Program
Contact Us
Trading Forum
How-to Lessons
About Us
Terms of Use

Copyright 2019
Social Media
Follow us on Facebook
Twitter Follow us on Twitter
Follow us on Google+
RSS Trading Items

Trading financial instruments, including foreign exchange on margin, carries a high level of risk and is not suitable for all investors. The high degree of leverage can work against you as well as for you. Before deciding to invest in financial instruments or foreign exchange you should carefully consider your investment objectives, level of experience, and risk appetite. The possibility exists that you could sustain a loss of some or all of your initial investment and therefore you should not invest money that you cannot afford to lose. You should be aware of all the risks associated with trading and seek advice from an independent financial advisor if you have any doubts.