Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Determining the InstrumentType in order to set IsExitOnSessionCloseStrategy

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

    Determining the InstrumentType in order to set IsExitOnSessionCloseStrategy

    how can I write this code correctly?

    it works... but the help documentation makes me a bit worried about it.


    else if (State == State.Configure) {
    IsExitOnSessionCloseStrategy = Instrument.MasterInstrument.InstrumentType == InstrumentType.Future;

    }

    I want to disable IsExitOnSessionCloseStrategy for Forex or CFDs but leave it enabled for Futures

    HELP:

    IsExitOnSessionCloseStrategy

    Warnings:

    •This property should ONLY bet set from the OnStateChange() method during State.SetDefaults or State.Configure

    Instrument
    Warning: The properties in this class should NOT be accessed within the OnStateChange() method before the State has reached State.DataLoaded


    #2
    Hello NinjaCustomer,

    Thank you for the post.

    You are correct to be worried here, the note is warning that this property may not be populated before DataLoaded so what you are trying may not work in all use scenarios.

    While you can use this if it works for what you are doing if you find this does not work in one of the tools you would likely need to just use the standard option in the user interface to turn this on or off manually.

    I look forward to being of further assistance.

    Comment


      #3
      and I guess that setting IsExitOnSessionCloseStrategy in OnDataLoaded is not an option?

      Comment


        #4
        Hello NinjaCustomer,

        That is not specifically suggested no, you can certainly try that and see what the result is for you however that would not be the general help guide suggestion. This property only mentions it is best set from SetDefaults or Configure, there is currently no documented expectation past those points.

        I look forward to being of further assistance.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by NullPointStrategies, Today, 05:17 AM
        0 responses
        46 views
        0 likes
        Last Post NullPointStrategies  
        Started by argusthome, 03-08-2026, 10:06 AM
        0 responses
        126 views
        0 likes
        Last Post argusthome  
        Started by NabilKhattabi, 03-06-2026, 11:18 AM
        0 responses
        66 views
        0 likes
        Last Post NabilKhattabi  
        Started by Deep42, 03-06-2026, 12:28 AM
        0 responses
        42 views
        0 likes
        Last Post Deep42
        by Deep42
         
        Started by TheRealMorford, 03-05-2026, 06:15 PM
        0 responses
        46 views
        0 likes
        Last Post TheRealMorford  
        Working...
        X