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

Day of week Entry Exit

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

    Day of week Entry Exit

    I have a simple strategy that i am working on. It trades only Friday close. As i only use daily data i have made it so that it uses Mondays open, due to the limitations on access to historical intra-day data.

    So what i have been trying to accomplish is for the strategy to open a position on Friday, then also close last week Fridays position. So each Fridays "close" the strategy closes last weeks position and also opens a new position for the coming week.

    The problem i am getting is that the script works as per i have noted, but only sometimes. Sometimes, it only closes the previous weeks position but does not open the new coming weeks position.
    I have attached the back-test and script to view. You can see that their is a string of opening and closing trades, but then every now and again their is missing some entry orders.
    I have tried 2 entries per direction but that made no differance

    I assume it is something simple i am missing in my script.
    Attached Files
    Last edited by novityam; 12-26-2015, 12:35 AM.

    #2
    Hello novityam,

    Thank you for your inquiry and welcome to the NinjaTrader Support Forum!

    Have you done any steps to debug your code?

    I would recommend using Prints to see if your logic to make an entry is true or not.

    More about debugging code can be found on our support forum at this link: http://ninjatrader.com/support/forum...58&postcount=1
    Zachary G.NinjaTrader Customer Service

    Comment


      #3
      Reply

      Hi, Thanks for the reply. I have run the print command and not sure what i am looking for as it is the same as i would expect as per the chart and as per i have coded it. Their is nothing specifically wrong with the entries, the strategy enters when it is supposed to. My problem is that it does not do continual entries. Meaning; as the strategy only enters and exits once a week on the Friday close(i use Monday opening prices for this), i need it to enter the new weeks position, and exit the previous weeks position. Currently the strategy does not do this, so i must have a loop wrong or something. Currently the strategy only enters once, then has a week gap where their are no trades and then trades the next week again. So it only trades one "cycle" when it should be closing the old and reopening the new. Let me know if that clarifies the problem.

      Comment


        #4
        novityam,

        Can you send us your strategy and a screenshot of the settings used?

        If you prefer you can send these to platformsupport[at]ninjatrader[dot]com with 'ATTN: Zach - 1436778' in the subject line.

        You can attach your strategy to your response by going to File > Utilities > Export NinjaScript > Export selected source files > select your strategy > select the right arrow > Export. The file will be located under (My) Documents\NinjaTrader 7\bin\Custom\ExportNinjaScript.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by frslvr, 04-11-2024, 07:26 AM
        9 responses
        121 views
        1 like
        Last Post caryc123  
        Started by rocketman7, Today, 09:41 AM
        4 responses
        15 views
        0 likes
        Last Post rocketman7  
        Started by selu72, Today, 02:01 PM
        1 response
        9 views
        0 likes
        Last Post NinjaTrader_Zachary  
        Started by WHICKED, Today, 02:02 PM
        2 responses
        15 views
        0 likes
        Last Post WHICKED
        by WHICKED
         
        Started by f.saeidi, Today, 12:14 PM
        8 responses
        21 views
        0 likes
        Last Post f.saeidi  
        Working...
        X