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

Exit on Close

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

    Exit on Close

    Hey guys, is there a way to track the execution price and quantity of an exit on Close order that is automatic?

    For example like,
    protected override void OnExecution(IExecution execution)
    {
    holdQuantity = execution.Quantity;
    }

    #2
    Hello elitetradernyc,

    Yes, you may check the name of the execution.Name to see if it matches the "Exit on close" order. For example:

    Code:
    protected override void OnExecution(IExecution execution)
    {
    	if(execution.Name == "Exit on close")
    	{
    		Print("Price: "+execution.Price+" Quantity: "+execution.Quantity); 
    	}
    }
    JCNinjaTrader Customer Service

    Comment


      #3
      Hi, sir, is there a way to override the ExitOnClose method? Do you have an example?

      Thanks,
      EliteTraderNYC

      Comment


        #4
        Hello EliteTraderNYC,

        You may be able to change the enable or disable the "ExitOnClose" and change the "ExitOnCloseSeconds" via NinjaScript but there is not a way to overload the "Exit on close" method that I am aware of no.

        You may however, program in your own order like the "ExitOnClose" with some custom programming. For example you may use a time filter and check to see what position you are in an then send an exit order at the time that you want. If you want to get the Session Template times you may use the "GetNextBeginEnd" method.



        Happy to be of further assistance.
        JCNinjaTrader Customer Service

        Comment


          #5
          Is there a way to have no session end time. I am using renko bars with a custom indicator and depending on how the last bar fills or not it effects my indicator. I would like to have no session end time or beginning time. is there a way to do so. If the market picks up where it closes then the bar will just try to keep filling it it gaps to high or low then i will just be missing a bar i suppose. this is for forex markets

          Comment


            #6
            Originally posted by hifreq View Post
            Is there a way to have no session end time. I am using renko bars with a custom indicator and depending on how the last bar fills or not it effects my indicator. I would like to have no session end time or beginning time. is there a way to do so. If the market picks up where it closes then the bar will just try to keep filling it it gaps to high or low then i will just be missing a bar i suppose. this is for forex markets
            Create a custom "session template" that spans the week with no breaks.

            Comment


              #7
              that what i have done but I dont want the break between Friday's close and Sunday night's open

              Comment


                #8
                Originally posted by hifreq View Post
                that what i have done but I dont want the break between Friday's close and Sunday night's open
                "Session Templates" span a week at most. I doubt that there is anything that can be done there with NT7.

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by pmachiraju, 11-01-2023, 04:46 AM
                8 responses
                148 views
                0 likes
                Last Post rehmans
                by rehmans
                 
                Started by mattbsea, Today, 05:44 PM
                0 responses
                5 views
                0 likes
                Last Post mattbsea  
                Started by RideMe, 04-07-2024, 04:54 PM
                6 responses
                33 views
                0 likes
                Last Post RideMe
                by RideMe
                 
                Started by tkaboris, Today, 05:13 PM
                0 responses
                5 views
                0 likes
                Last Post tkaboris  
                Started by GussJ, 03-04-2020, 03:11 PM
                16 responses
                3,282 views
                0 likes
                Last Post Leafcutter  
                Working...
                X