Download software Tutorial videos
Subscription & data-feed pricing Class schedule


New account application Trading resources
Margin rates Stock & option commissions

Attention: Discussion forums are read-only for extended maintenance until further notice.
Welcome Guest, please sign in to participate in a discussion. Search | Active Topics |

Spikes in market indicator -> condition Rate this Topic:
Previous Topic · Next Topic Watch this topic · Print this topic ·
rassom
Posted : Thursday, June 24, 2010 4:54:08 PM
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
Bruce_L
Posted : Thursday, June 24, 2010 5:04:12 PM


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
Users browsing this topic
Guest-1

Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.