Registered User Joined: 3/18/2009 Posts: 61
|
Hi,
I've created a market indicator that gives me buy/sell signals when it spikes below -50 and above 50
A spike is defined as moving down one day then moving up the next and vice versa. In the image above there are 3 spikes above 50 and 2 below -50.
Now, how do I create a condition that makes me able to backtest these buy/sell signals?
Thanks,
Rasmus
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
If you Drag and Drop the Market Indicator into the Code tab of the RealCode Editor it should create something similar to the first line of the following RealCode Condition to search for Spikes above 50:
'# MI = chart.MarketIndicator
If MI.Value(1) > 50 AndAlso _
MI.Value < MI.Value(1) AndAlso _
MI.Value(1) > MI.Value(2) Then Pass
The RealCode Condition for Spikes below -50 would be similar:
'# MI = chart.MarketIndicator
If MI.Value(1) < -50 AndAlso _
MI.Value > MI.Value(1) AndAlso _
MI.Value(1) < MI.Value(2) Then Pass
The actual variable name you will need to use in the RealCode Conditions will depend on the actual name of the Dragged and Dropped Market Indicator.
-Bruce Personal Criteria Formulas TC2000 Support Articles
|