Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Moving Average Cross overs

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Moving Average Cross overs

    I have view the videos and manual.
    Can Market Analyser be used to alert for a simple moving average cross over?

    #2
    Yes, this is possible upon creating a custom indicator and load it in an Indicator column in the Market Analyzer. More information regarding creating custom indicators can be found at the link below.

    Comment


      #3
      MA cross over in Analyser

      I have created the following indicator which works fine on my charts.
      How would I adapt it so i could use it as a true false indicator in column in Analyser

      if (CrossAbove(SMA(Close, 5), SMA(Close, 20), 1))
      {
      CandleOutlineColor = Color.Red;
      BarColor = Color.Yellow;
      }

      Comment


        #4
        Hi cptrader, yes just create another indicator and use this snippet below as an idea -

        Code:
        [SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]if[/COLOR][/SIZE][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][SIZE=2] (CrossAbove(SMA(Close, [/SIZE][/SIZE][SIZE=2][COLOR=#800080][SIZE=2][COLOR=#800080][SIZE=2][COLOR=#800080]5[/COLOR][/SIZE][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][SIZE=2]), SMA(Close, [/SIZE][/SIZE][SIZE=2][COLOR=#800080][SIZE=2][COLOR=#800080][SIZE=2][COLOR=#800080]20[/COLOR][/SIZE][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][SIZE=2]), [/SIZE][/SIZE][SIZE=2][COLOR=#800080][SIZE=2][COLOR=#800080][SIZE=2][COLOR=#800080]1[/COLOR][/SIZE][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][SIZE=2]))[/SIZE]
        [SIZE=2]{[/SIZE]
        [SIZE=2]trueFalse = [/SIZE][/SIZE][SIZE=2][COLOR=#800080][SIZE=2][COLOR=#800080][SIZE=2][COLOR=#800080]1[/COLOR][/SIZE][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][SIZE=2];[/SIZE]
        [SIZE=2]}[/SIZE]
        [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]else[/COLOR][/SIZE][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][SIZE=2] if (trueFalse == [/SIZE][/SIZE][SIZE=2][COLOR=#800080][SIZE=2][COLOR=#800080][SIZE=2][COLOR=#800080]0)[/COLOR][/SIZE][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]
         
        [SIZE=2]Plot0.Set(trueFalse);[/SIZE]
        [/SIZE]
        You would of course need to define trueFalse as private double in your variables.

        In the next step you can then reference these Plot values in your Market Analyzer alert or coloring conditions.

        Comment


          #5
          Hi Bertrand

          Need alittle help defining trueFalse as private double in variables.
          I looked at the Tutorial using price variables (Level1), need more help please. Thanks, Appreciated.

          Comment


            #6
            gary9,

            Code:
            private double trueFalse = 0;
            In Variables section of the code.
            Josh P.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by argusthome, 03-08-2026, 10:06 AM
            0 responses
            110 views
            0 likes
            Last Post argusthome  
            Started by NabilKhattabi, 03-06-2026, 11:18 AM
            0 responses
            59 views
            0 likes
            Last Post NabilKhattabi  
            Started by Deep42, 03-06-2026, 12:28 AM
            0 responses
            37 views
            0 likes
            Last Post Deep42
            by Deep42
             
            Started by TheRealMorford, 03-05-2026, 06:15 PM
            0 responses
            41 views
            0 likes
            Last Post TheRealMorford  
            Started by Mindset, 02-28-2026, 06:16 AM
            0 responses
            78 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Working...
            X