Topic: Moving Average Crossover

Hi, I'm wondering if anyone has run into this situation.  I'm trying to build a strategy in which I want to go short if the fast MA crosses the slow MA downward.  However, it seems that if the fast MA crosses the slow MA upward and not downward it is still triggering the entry.  I have no problem with the long entries ma corssover, it seems to work fine.  I looked at the source code but it's kind of greek to me.  Can anyone explain to me what is going on or better yet how to trigger my strategy when the fast MA crosses under the slow MA?  Thank you.

Re: Moving Average Crossover

You can use the Moving Average Crossover indicator.

It works in both directions pretty well. See this example:

A same direction signal - Does nothing
An opposite direction signal - Reverses the position
Permanent Stop Loss - None

[Opening Point of the Position]
Bar Opening
     Enter the market at the beginning of the bar
     Base price  -  Open

[Opening Logic Condition]
Moving Averages Crossover
     The Fast MA crosses the Slow MA upward
     Base price  -  Close
     Fast MA method  -  Simple
     Slow MA method  -  Simple
     Fast MA period  -  13
     Slow MA period  -  21
     Fast MA shift  -  0
     Slow MA shift  -  0
     Use previous bar value  -  Yes

[Closing Point of the Position]
Close and Reverse
     Close all positions and open a new one in the opposite direction

http://www.postimage.org/aV1Ch1_J.jpg

Re: Moving Average Crossover

Is it possible to set the base prices of the moving average crossover to be different? I am looking at doing a moving average cross of averages based on the open and of the close. The logic conditions don't allow you to set the base price for the  second moving average but it has a greyed out selection panel that looks as if it could be easy to add.

Re: Moving Average Crossover

Here you are, my first really useful indi I coded a while back.

Miroslav said it's logically incorrect, but it works brilliantly nevertheless.

Post's attachments

custom mov av crss.cs 13.24 kb, 107 downloads since 2011-09-23 

You don't have the permssions to download the attachments of this post.

Re: Moving Average Crossover

Thanks footon!

I'll check it out.

Re: Moving Average Crossover

footon wrote:

Here you are, my first really useful indi I coded a while back.

Miroslav said it's logically incorrect, but it works brilliantly nevertheless.

This indicator is interesting because of what Footon has added. What would it take to be able to optimize the various aspects of the indicator in addition to the periods...?

Re: Moving Average Crossover

Blaiserboy wrote:

This indicator is interesting because of what Footon has added. What would it take to be able to optimize the various aspects of the indicator in addition to the periods...?

Only way I suppose would be putting it into the generator, and link its slot.