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

Edit strategy = strategy CRASH!

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

    Edit strategy = strategy CRASH!

    I am using the strategy builder in Ninja 8.0.0.11 for the first time. I created the simplest of strategies to start where the HMA crosses the EMA, enter an order. Cross above = Long and cross below = Short. Target was set at 250 ticks and trailing stop at 45 ticks. All was well and good when back testing even as much as 8 years worth of data. Then I went back and tried to change some parameters and it quit testing. I tried deleting the the strategy several times and starting over with a new name, same parameters and I get the same result. Make an edit and lose the results. When I mean lose the results I mean that it returns no test data. I even went with the most minor of edits by selecting the box to plot the indicators on the chart, nothing else, and still returned no results. I changed it back and no results.

    Am I doing something wrong here? I have tried restarting Ninja and restarting my machine several times but nothing seems to fix this.

    Also, I would like to add that the default for the ?MAs is 14, I have tried to change that and it always comes back to 14. I can set it to another number and in the code you will see 14. Reopen the strategy editor and you will see 14. I provided the simple code below for your reference. Thanks in advance.

    Best regards,

    Dolfan

    PS. Message update... After initialing typing this message I figured I would go and unlock the code and manually edit. Got nothing to lose, right? POOF! As soon as I hit 'Unlock Code', the strategy disappeared from the list. What the sam hill! GEEZ is this not yet fully baked or what? Somebody tell me what I am doing wrong please!


    //This namespace holds Strategies in this folder and is required. Do not change it.
    namespace NinjaTrader.NinjaScript.Strategies
    {
    public class wtf : Strategy
    {
    private HMA HMA1;
    private EMA EMA1;

    protected override void OnStateChange()
    {
    if (State == State.SetDefaults)
    {
    Description = @"Enter the description for your new custom Strategy here.";
    Name = "wtf";
    Calculate = Calculate.OnBarClose;
    EntriesPerDirection = 1;
    EntryHandling = EntryHandling.AllEntries;
    IsExitOnSessionCloseStrategy = true;
    ExitOnSessionCloseSeconds = 30;
    IsFillLimitOnTouch = false;
    MaximumBarsLookBack = MaximumBarsLookBack.TwoHundredFiftySix;
    OrderFillResolution = OrderFillResolution.Standard;
    Slippage = 0;
    StartBehavior = StartBehavior.WaitUntilFlat;
    TimeInForce = TimeInForce.Gtc;
    TraceOrders = false;
    RealtimeErrorHandling = RealtimeErrorHandling.StopCancelClose;
    StopTargetHandling = StopTargetHandling.PerEntryExecution;
    BarsRequiredToTrade = 20;
    // Disable this property for performance gains in Strategy Analyzer optimizations
    // See the Help Guide for additional information
    IsInstantiatedOnEachOptimizationIteration = true;
    }
    else if (State == State.Configure)
    {
    HMA1 = HMA(14);
    EMA1 = EMA(14);
    SetProfitTarget("250", CalculationMode.Ticks, 0);
    SetTrailStop("45", CalculationMode.Currency, 0, false);
    }
    }

    protected override void OnBarUpdate()
    {
    // Set 1
    if (CrossAbove(HMA1, EMA1, 0))
    {
    EnterLong(1, "");
    }
    // Set 2
    if (CrossBelow(HMA1, EMA1, 0))
    {
    EnterShort(1, "");
    }

    }
    }
    }
    Last edited by Dolfan; 06-20-2016, 07:16 AM.

    #2
    Hello Dolfan,

    Thank you for your post.

    There appears to be no issue with the code you provided. Can you send the strategy .cs file and your log and trace files to platformsupport[at]ninjatrader[dot]com with 'ATTN: Patrick H - 1532111' in the subject line?

    You can do this by going to the Control Center-> Help-> Email Support-> select Attachment-> locate the strategy under Documents\NinjaTrader 8\bin\Custom\Strategy-> ensure the log and trace option is enabled-> Send.

    Comment


      #3
      Patrick,

      It is trying to send but taking a very long time. Is it normal to take so long? Let me know if you do not get it on your end.Dolfan

      Comment


        #4
        I received a message that said it is unable to attache the file. Thoughts?

        Comment


          #5
          Hello Dolfan,

          Thank you for your response.

          Please try using your email client directly and attach the strategy form NinjaTrader 8\bin\Custom\Strategies in your documents.
          For the log and trace files, try sending them through the Help > Email support option without attaching the strategy.

          Comment


            #6
            I sent the file from a different machine and the trace and log resend seems to have stumped my trading machine once again. Your thoughts?

            Dolfan

            Comment


              #7
              Hello Dolfan,

              I followed up with you via email. I will continue to work with you via email.

              Comment


                #8
                Patrick,

                I made this video and since it is 2.9MB, I didn't want to email it to you. It clearly shows what is frustrating me. You can see that I had already created this strategy with the simple crossover and went in to change the bar settings from the default of 14 to 7 for the HMA and 21 for the EMA. I then changed the look back bars option as you suggested, then compiled successfully. After reopening, the settings have reverted back again. Very frustrating. As per my email, I have no problems when unlocking the code and editing. Your thoughts?

                Best regards,

                Dolfan

                Free online storage and sharing with Screencast.com. 2 GB of storage and 2 GB of bandwidth per month for free. We won't compress, alter or take ownership of your content.

                Comment


                  #9
                  Hello Dolfan,

                  Thank you for that video. That clearly demonstrates the matter. I will report to development on this matter.

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by rocketman7, Today, 09:41 AM
                  0 responses
                  1 view
                  0 likes
                  Last Post rocketman7  
                  Started by rocketman7, Today, 02:12 AM
                  7 responses
                  31 views
                  0 likes
                  Last Post NinjaTrader_ChelseaB  
                  Started by guillembm, Yesterday, 11:25 AM
                  3 responses
                  16 views
                  0 likes
                  Last Post NinjaTrader_Jesse  
                  Started by junkone, 04-21-2024, 07:17 AM
                  10 responses
                  149 views
                  0 likes
                  Last Post NinjaTrader_BrandonH  
                  Started by tsantospinto, 04-12-2024, 07:04 PM
                  6 responses
                  101 views
                  0 likes
                  Last Post tsantospinto  
                  Working...
                  X