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

A system

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

    A system

    Hi, I'm trying to programm this sistem but I can't get it. Can anyone help me please?

    The system is like this:

    The rule is to buy on the open every Monday if that open is lower than Friday's close.

    Thank you.

    #2
    joburg, can you show us the code you already have so we can start pointing you in the right direction?
    AustinNinjaTrader Customer Service

    Comment


      #3
      Ok this is the complete system: It is describe in the book Long Term Secrets to Short Term Trading Larry Williams:
      It's to buy on the open every Monday if that open is lower than Friday's close. A stoploss of 3000 $ and a target profit of 500 $.The system is for Daily Bars for S&P 500.

      This is the code I'm programming:

      Iniatialize()
      {
      CalculateOnBarClose = true;
      SetStopLoss(3000, true);
      SetProfitTarget(500);

      OnBarUpdate()

      if (Time[0].DayOfWeek != DayOfWeek.Tuesday && Time[0].DayOfWeek != DayOfWeek.Wenesday && Time[0].DayOfWeek != DayOfWeek.Thursday &&Time[0].DayOfWeek != DayOfWeek.Friday

      if (Open[0] < Close[1])
      {
      EnterLong(DefaultQuantity, "");
      }

      I'm not sure if I'm right. Can anyone help me?

      Comment


        #4
        joburg, we would not be familiar with that specific system rules, but the code look ok and should compile for you - are you seeing any issues if you backtest ist?
        BertrandNinjaTrader Customer Service

        Comment


          #5
          I have tested it and it's ok.Finally I got it!!!

          Thank you.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by kempotrader, Today, 08:56 AM
          0 responses
          6 views
          0 likes
          Last Post kempotrader  
          Started by kempotrader, Today, 08:54 AM
          0 responses
          4 views
          0 likes
          Last Post kempotrader  
          Started by mmenigma, Today, 08:54 AM
          0 responses
          2 views
          0 likes
          Last Post mmenigma  
          Started by halgo_boulder, Today, 08:44 AM
          0 responses
          1 view
          0 likes
          Last Post halgo_boulder  
          Started by drewski1980, Today, 08:24 AM
          0 responses
          4 views
          0 likes
          Last Post drewski1980  
          Working...
          X