Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Market analyzer seems, frozen..

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

    Market analyzer seems, frozen..

    Hi. I'm trying to run market analyzer with two indicator columns, based an indicator I've developed. It's the same indicator for each column with different parameters. In the code, I set Plot() to 0 or 1, for mere observational purposes, since I code in an alert to be thrown in the indicator code. I have COBC = true. I've loaded 75 bars into MA, as well as each indicator column setting. When I run it, I don't see any 0 or 1's, just a few share prices, and then ellipses for most of the other cells. It's not updating or returning any values I expect. Any takers? My code is below...

    Code:
            protected override void OnBarUpdate()
            {
                if(Historical){return;}
                
                for (int index = 0; index < BarsArray.Length; index++) 
                {
                    if (CurrentBars[index] < (slowMA+12)) return;
                }
                
                if(BarsInProgress == 0)
                {
                    int retraceType = 0;
                    
                    //Is current intraday action favorable?
                    if(Close[0] > Open[0])
                    {
                        int uptrendCheckCount = 0;
                        int countOfClosesOverSlowEma = 0;
                        int priceLevelViolationEma = (int)Math.Round(slowMA*.85);
                        double todaysEstimatedDailySlowMovAvg = (EMA(Closes[1],slowMA)[0] + Math.Abs(EMA(Closes[1],slowMA)[0] - EMA(Closes[1],slowMA)[1]));
                        double keyPriceViolationLevelToday = (EMA(Closes[1],priceLevelViolationEma)[0] + 
                            Math.Abs(EMA(Closes[1],priceLevelViolationEma)[0] - EMA(Closes[1],priceLevelViolationEma)[1]));
                        
                        //Make sure current price is > today's estimated slow daily MA.
                        if((Close[0] > todaysEstimatedDailySlowMovAvg) && (Close[0] < keyPriceViolationLevelToday))
                        {
                            //Check for uptrend on daily
                            for(int i = 0;i < 10;i++)
                            {
                                //Count up mov avg lines are stacked daily bars
                                if((EMA(Closes[1],fastMA)[i] >= EMA(Closes[1],medMA)[i]) && (EMA(Closes[1],medMA)[i] >= EMA(Closes[1],slowMA)[i]))
                                    uptrendCheckCount++;
                                
                                //Count up past closes >= slow ma line
                                if(Closes[1][i] >= EMA(Closes[1],slowMA)[i])
                                    countOfClosesOverSlowEma++;
                            }
                            
                            if((countOfClosesOverSlowEma == 10) && (uptrendCheckCount == 10))    //if it's an uptrend
                            {
                                retraceType = 1;
                                Alert("Alert1" + CurrentBar, Priority.Medium, "RetraceToEMA120612-" + slowMA, "Alert2.wav", 0, 
                                    Color.Aquamarine, Color.Black);
                            }
                        }
                    }
                    
                    Plot0.Set(retraceType);
                }
            }

    #2
    Hello CSharpTrader,
    So that I can test it further can you please upload actual code (the cs file).

    You may also send it to support[AT]ninjatrader[DOT]com

    Please append Attn:Joydeep in the subject line of the email and give a reference of this thread in the body of the email.

    I look forward to assisting you further.
    JoydeepNinjaTrader Customer Service

    Comment


      #3
      Thanks Joydeep. I sent it along, to your attention.

      Comment


        #4
        Hello CSharpTrader,
        Unfortunately I did not received your email. Can you please resend it again.
        JoydeepNinjaTrader Customer Service

        Comment


          #5
          I just resent.

          Comment


            #6
            Hello CSharpTrader,
            This is to confirm I have received your email and have replied to it.
            JoydeepNinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by rhyminkevin, Today, 04:58 PM
            3 responses
            48 views
            0 likes
            Last Post Anfedport  
            Started by iceman2018, Today, 05:07 PM
            0 responses
            5 views
            0 likes
            Last Post iceman2018  
            Started by lightsun47, Today, 03:51 PM
            0 responses
            7 views
            0 likes
            Last Post lightsun47  
            Started by 00nevest, Today, 02:27 PM
            1 response
            14 views
            0 likes
            Last Post 00nevest  
            Started by futtrader, 04-21-2024, 01:50 AM
            4 responses
            50 views
            0 likes
            Last Post futtrader  
            Working...
            X