Triple MA

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #10063 quote
    absent1980
    Participant
    Average

    Is this correct code for two faster MAs crossing slow MA?

    // Conditions to enter long positions
    indicator1 = ExponentialAverage[fast 1](close)
    indicator2 = ExponentialAverage[fast 2](close)
    indicator3 = ExponentialAverage[slow](close)
    c1 = (indicator1 and indicator2) CROSSES OVER indicator3
    
    IF c1 THEN
    BUY Positionsize PERPOINT AT MARKET
    ENDIF

    Thank you.

    #10069 quote
    Nicolas
    Keymaster
    Master

    fast1 and fast2 variables must be set of course and they can’t have blank space in their names.

    Also, I don’t know what is your fast moving average periods, but I believe that 2 of them can cross a long term one at the same moment and that’s what you have coded at line 5 with your c1 condition. I don’t know what is your strategy all about but maybe you could test if the first fast MA is already above the slowest one and then test the fast2 cross over the slow MA.

    #10097 quote
    absent1980
    Participant
    Average

    It is basically to reduce the noise and not to enter position until two faster averages crossed slow average.

    Nicolas, thank you for your replies. I also looked at your previous post on adaptive moving averages. Do you know if there is a way to code a difference between AMA(n),AMA(n-1) etc, where ‘n’ is a current bar? Is it possible to code change in direction of AMA as a signal?

    #10098 quote
    absent1980
    Participant
    Average

    Seems i found it AMA>AMA[1]>AMA[2] etc.

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.

Triple MA


ProBuilder: Indicators & Custom Tools

New Reply
Author
author-avatar
absent1980 @absent1980 Participant
Summary

This topic contains 3 replies,
has 2 voices, and was last updated by absent1980
9 years, 7 months ago.

Topic Details
Forum: ProBuilder: Indicators & Custom Tools
Language: English
Started: 06/30/2016
Status: Active
Attachments: No files
Logo Logo
Loading...