Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Problem !!

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

    Problem !!

    Hello, I have designed a strategy but I susceden very strange to run a live simulation mode. What happens is that when I enter the market with automated strategy candle I currently trades at that time and subsequently these candles do not correspond with market reality disappears. (Attached picture) This makes the graph go wrongly and therefore building the strategy may not work as me on the backtesting.

    Thank you very much.
    Attached Files

    #2
    Hello,

    Can you please clarify who you connect to for data? This is displayed in the bottom left hand corner of the NinjaTrader Control Center.

    Were both charts open at the same time?

    What happens when you right click and select 'reload all historical data'. Do the charts backfill correctly?
    MatthewNinjaTrader Product Management

    Comment


      #3
      The connection is with CQC, the two graphs shown in this picture are open at the same time. When recharging historical data appears correctly however to re-enter a position becomes automated strategy to **** the graph.

      When backtesting the strategy everything is correct, I see entries in the chart and all good, all that happens to do it live.

      There will be an error in the programming? You wish to copy the instructions and system conditions?

      Thank you very much.
      Last edited by NinjaTrader_Matthew; 01-10-2014, 11:23 AM.

      Comment


        #4
        Hi,

        Thanks confirming. I'm unware of anything that would cause that behavior and seems very unsual.

        At this point would would need to simplify and isolte that chart to see what might be causing that behavior.

        For example, if you remove any other indicators such as the custom timer, do you see the same behavior?

        What happens if you start the SampleMACrossOver strategy? Do you see the same behavior, or does the chart work well then?

        We'll be happy to run further tests with your strategy on our end should wish to send that into support[at]ninjatrader[dot]com and we can confirm if we see the same behavior.
        MatthewNinjaTrader Product Management

        Comment


          #5
          Problem

          Originally posted by NinjaTrader_Matthew View Post
          Hi,

          Thanks confirming. I'm unware of anything that would cause that behavior and seems very unsual.

          At this point would would need to simplify and isolte that chart to see what might be causing that behavior.

          For example, if you remove any other indicators such as the custom timer, do you see the same behavior?

          What happens if you start the SampleMACrossOver strategy? Do you see the same behavior, or does the chart work well then?

          We'll be happy to run further tests with your strategy on our end should wish to send that into support[at]ninjatrader[dot]com and we can confirm if we see the same behavior.

          Hi Matthew, I think the problem is the strategy and I checked what you told me and these problems do not appear in the graphics. Only happens with this strategy that I attached below. The truth is that I can not understand why doing backtesting chart entries in the successful, but to put it in real mode simulated the problem as the graphics and therefore the strategy is not working properly. Something very strange. I ask your help please. I am contacting you can support me or help you Matthew?

          Thank you so much.

          Comment


            #6
            I'm not aware of anything off the top of my head that would cause this to happen and would need to review the strategy, if that is possible.

            Otherwise you will need to simplify and debug your code to isolate this behavior.
            MatthewNinjaTrader Product Management

            Comment


              #7
              I have copied the strategy Matthew if you please, and you manage to find the fault.


              #region Variables
              // Wizard generated variables
              private int indicador = 5; // Default setting for Indicador
              private int stopLoss = 10; // Default setting for StopLoss
              private int takeProfit = 20; // Default setting for TakeProfit
              // User defined variables (add any user defined variables below)
              #endregion

              /// <summary>
              /// This method is used to configure the strategy and is called once before any strategy method is called.
              /// </summary>
              protected override void Initialize()
              {
              Add(Swing(High, 0));
              Add(Swing(Low, 0));
              SetStopLoss("", CalculationMode.Ticks, StopLoss, false);
              SetProfitTarget("", CalculationMode.Ticks, TakeProfit);

              CalculateOnBarClose = false;
              }

              /// <summary>
              /// Called on each bar update event (incoming tick)
              /// </summary>
              protected override void OnBarUpdate()
              {
              // Condition set 1
              if (Close[-2] >= Swing(High, 0).SwingHigh[0])
              {
              EnterLong(DefaultQuantity, "");
              }

              // Condition set 2
              if (Close[-2] <= Swing(Low, 0).SwingLow[0])
              {
              EnterShort(DefaultQuantity, "");
              }
              }

              #region Properties
              [Description("")]
              [GridCategory("Parameters")]
              public int Indicador
              {
              get { return indicador; }
              set { indicador = Math.Max(1, value); }
              }

              [Description("")]
              [GridCategory("Parameters")]
              public int StopLoss
              {
              get { return stopLoss; }
              set { stopLoss = Math.Max(1, value); }
              }

              [Description("")]
              [GridCategory("Parameters")]
              public int TakeProfit
              {
              get { return takeProfit; }
              set { takeProfit = Math.Max(1, value); }
              }
              #endregion

              Comment


                #8
                You are referencing negative bar indexes which is not supported

                In backtesting there is a bar -2 that can be used and allows you to "peak" ahead, but that is not encouraged and does not work in real-time.

                If you're trying to refer to the Close value 2 bars ago, you'll want to use Close[2]

                More information found here:

                MatthewNinjaTrader Product Management

                Comment


                  #9
                  Thank you very much if that was the problem. However i was testing yesterday and today working and not even having the parameter that has shown me negative.

                  Thank you very much.

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by benmarkal, Yesterday, 12:52 PM
                  3 responses
                  23 views
                  0 likes
                  Last Post NinjaTrader_Gaby  
                  Started by helpwanted, Today, 03:06 AM
                  1 response
                  19 views
                  0 likes
                  Last Post sarafuenonly123  
                  Started by Brevo, Today, 01:45 AM
                  0 responses
                  11 views
                  0 likes
                  Last Post Brevo
                  by Brevo
                   
                  Started by pvincent, 06-23-2022, 12:53 PM
                  14 responses
                  244 views
                  0 likes
                  Last Post Nyman
                  by Nyman
                   
                  Started by TraderG23, 12-08-2023, 07:56 AM
                  9 responses
                  388 views
                  1 like
                  Last Post Gavini
                  by Gavini
                   
                  Working...
                  X