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

Not sure how IsExitOnSessionCloseStrategy works

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

  • NinjaTrader_ChrisL
    replied
    Hello NeverDownMoney, thanks for your reply.

    IsFirstTickOfBar would work to mark the very first tick of the session. If that is true, set a bool to true and once a single trade is made, set the bool to false to prevent trading for the rest of the day.

    Leave a comment:


  • NeverDownMoney
    replied
    I don't think that IsFirstBarOfSession and IsLastBarOfSession properties will work for a tick by tick Day strategy, From documentation -
    Warning: This property will always return false on non-intraday bar periods (e.g., Day, Month, etc). For checking for new non-intraday bar updates, please see IsFirstTickOfBar

    Perhaps I should use IsFirstTickOfBar instead?

    Currently I am watching for -

    // Keep track of whether it is the end of session or not to
    if (order.Name == "Exit on close") { isEntrySubmitted = false; }

    Leave a comment:


  • NinjaTrader_ChrisL
    replied
    Hello NeverDownMoney, thanks for your post.

    On the stop and target applied to an entry order: If the entry with protective orders gets closed out the protective orders will also get canceled, this is due to the use of the Managed Approach. You can target specific entry orders by matching up its signal name parameter with the "fromSignalName" parameter when you set up the stop and target.

    We have the IsFirstBarOfSession and IsLastBarOfSession properties:




    You could check these for true and set the proper booleans at that time. Other than this method, you would need to monitor the system time with the DateTime object to know the precise time after the RealTime state is reached (which means this will not be backtestable).

    Kind regards,
    -ChrisL

    Leave a comment:


  • Not sure how IsExitOnSessionCloseStrategy works

    Hey I have set IsExitOnSessionCloseStrategy and it corresponding ExitOnSessionCloseSeconds and I am not sure how these properties actually work. It would be nice to understand the underlying mechanics of them.

    Some questions I have about it are. If I have an entry in the market with a corresponding target and stop entries and market close occurs are those entries cancelled and how does it happen. Do I need to associate my entry, target and stop orders with the exit on close order that may be submitted?

    Is there anyway to know when this event actually occurs in code, i.e. is there an event that can be over ridden? The reason I ask is that I have an intraday tick by tick strategy that has an entry that keeps getting filled multiple times per session and I would like it to only set up once per trading session. I could set up a variable that gets set false at session close and then gets set true when my first and only entry order gets submitted and accepted for that day. That way I can check to make sure I am only getting one order submitted/accepted per strategy session.

Latest Posts

Collapse

Topics Statistics Last Post
Started by funk10101, Today, 09:43 PM
0 responses
3 views
0 likes
Last Post funk10101  
Started by pkefal, 04-11-2024, 07:39 AM
11 responses
36 views
0 likes
Last Post jeronymite  
Started by bill2023, Yesterday, 08:51 AM
8 responses
44 views
0 likes
Last Post bill2023  
Started by yertle, Today, 08:38 AM
6 responses
26 views
0 likes
Last Post ryjoga
by ryjoga
 
Started by algospoke, Yesterday, 06:40 PM
2 responses
24 views
0 likes
Last Post algospoke  
Working...
X