Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

strategy is set to false

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

    strategy is set to false

    Sometimes I have the problem that after closing a position, the strategy is set to false, and although the account is set to flat, the strategy is set to false and still appears as the open position, how can I solve this?
    if (IsFirstTickOfBar && ActivarPerdidaDiaria && (PnlReal <= -MaxPerdidaDiaria))
    {
    PerdidaOk = true;
    IndicadorOculto = true;
    if (Position.MarketPosition == MarketPosition.Long && Position.Quantity != 0 && ContadorCancelaciones)
    {
    CancelOrder(OrdenStop);
    ContadorCancelaciones = false;
    SubmitOrderUnmanaged(0, OrderAction.Sell, OrderType.Market, Position.Quantity, 0, 0, "", "CIERRE POR PERDIDA");
    OrdenEntrada = null;
    OrdenStop = null;
    }

    if (Position.MarketPosition == MarketPosition.Short && Position.Quantity != 0 && ContadorCancelaciones)
    {
    CancelOrder(OrdenStop);
    ContadorCancelaciones = false;
    SubmitOrderUnmanaged(0, OrderAction.Buy, OrderType.Market, Position.Quantity, 0, 0, "", "CIERRE POR PERDIDA"); ;
    OrdenEntrada = null;
    OrdenStop = null;
    }
    }

    In this specific case, when it closes due to a daily loss, not always but sometimes it is false and the strategy stops working​

    #2
    aqui se ve como a cerrado la operacion y en la estrategia sigue poniendo 10 contratos y un banderin rojo, y creo que a partir de ahora ya no mete mas operaciones
    Attached Files

    Comment


      #3
      Hello franatas,

      Is the strategy becoming disabled on the Strategies tab of the Control Center?

      Is there an error appearing on the Log tab of the Control Center?
      If so, what is the full error message?
      Chelsea B.NinjaTrader Customer Service

      Comment


        #4
        no aparecen errores, solo que se queda como colgadas las ordenes que se cerraron, entonces aparece esa bandera roja y en las posiciones no se va a cero sino que se queda en este caso marcando 10 contratos, pero la operacion ya se cerro, la estrategia continua pero ya no mete operaciones porque el estado pasa a falso

        Comment


          #5
          Hello franatas,

          The red flag means this script is using multiple instruments from calling AddDataSeries() in the State.Configure of OnStateChange().
          This lets you know to expand the row so that the positions of the other instruments can be seen.

          From the help guide:
          "Sync - Compares the strategy position to the current real-world account position relative to the configured instrument. A value of true indicates the strategy position is currently in sync with the account position
          For Multi Instrument strategies, a small red flag can appear to the right of the sync value - this would alert the user to expand the row to check the sync for any additional instruments the strategy trades as well."
          Help guide: Operations > Control Center > Strategies Tab​ > Understanding the strategies tab

          ​Your screenshot appears to be showing the strategy position is flat for both instruments and the account position is flat for both instruments and that these are in sync.

          Can you clarify the issue you are experiencing?
          Chelsea B.NinjaTrader Customer Service

          Comment


            #6
            en la captura se ve 10L en el micro, no entiendo porque si la posicion es plana el mnq indica 10 largos

            Comment


              #7
              Hello franatas,

              While I am not able to read this language, it looks like you are looking at the Account name column?

              Have you named a Sim account 10L?

              It looks like the position and account columns are showing flat.
              Chelsea B.NinjaTrader Customer Service

              Comment


                #8
                ​The columns are shifted to the left and the account name column is missing. 10 l refers to 10 longs, which is the number of contracts that the strategy enters. When this is left unset, the strategy stops entering entries even if it is active.
                Attached Files

                Comment


                  #9
                  Hello franatas,

                  We may be looking at a corrupted install.

                  Please try uninstalling NinjaTrader, renaming the database, and re-installing NinjaTrader.
                  1. Close all running applications including NinjaTrader
                  2. Navigate to the Windows Settings > Apps > Installed apps
                  3. From the Uninstall or change a program window select NinjaTrader 8 -> click Uninstall
                  4. Delete any NinjaTrader installation files that still exist. These will be located in:
                    C:\Program Files\NinjaTrader 8
                  5. Open the Documents > NinjaTrader 8 > db folder
                  6. Right click on NinjaTrader.sqlite and select "Rename"
                  7. Rename the file ' Original NinjaTrader.sqlite'
                  8. Reboot your machine
                  9. Once these steps are completed, download NT8 from the link below:
                    Download
                  Chelsea B.NinjaTrader Customer Service

                  Comment


                    #10
                    fact, everything remains the same
                    Attached Files

                    Comment


                      #11
                      Hello franatas,

                      I would like to schedule a call with you to take a look.

                      Please send an email to scriptingsupport [at] ninjatrader.com.
                      In the email include a link to this forum thread.
                      Chelsea B.NinjaTrader Customer Service

                      Comment

                      Latest Posts

                      Collapse

                      Topics Statistics Last Post
                      Started by reekotubbs, Today, 01:09 PM
                      1 response
                      16 views
                      0 likes
                      Last Post NinjaTrader_LuisH  
                      Started by DJ888, Yesterday, 05:57 PM
                      1 response
                      17 views
                      0 likes
                      Last Post NinjaTrader_LuisH  
                      Started by lucyb, Yesterday, 04:09 PM
                      3 responses
                      19 views
                      0 likes
                      Last Post lucyb
                      by lucyb
                       
                      Started by DayTradingDEMON, Yesterday, 08:54 AM
                      12 responses
                      37 views
                      0 likes
                      Last Post NinjaTrader_Gaby  
                      Started by aligator, 06-05-2018, 01:25 AM
                      60 responses
                      5,920 views
                      10 likes
                      Last Post aligator  
                      Working...
                      X