Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to optimize a time parameter?

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

    How to optimize a time parameter?

    Hi,

    I'm trying to optimize a date in my strategy:

    [NinjaScriptProperty]
    [PropertyEditor("NinjaTrader.Gui.Tools.TimeEditorKe y")]
    [Display(Name="Box Start", Order=1, GroupName="Box")]
    public DateTime BoxStart
    { get; set; }

    In the same way as I optimize the Take Profit parameter with the "Range" property:

    [NinjaScriptProperty]
    [Range(0, double.MaxValue)]
    [Display(ResourceType = typeof(Custom.Resource), Name="Tp", Order=1, GroupName="Bet Size")]
    public double Tp
    { get; set; }

    But I can't find how to do it. I can't choose the date rage, nor the delta in the strategy analyser.

    How can I achieve that?

    Thanks​​

    #2
    Hello Vincere,

    Thanks for your post.

    The idea to optimize time is to use int inputs (public integer variables using the NinjaScriptProperty attribute) and use ToTime(Time[0]) to check the bar is between the optimized hour and minute values.

    A working example for the community on optimizing time could be found on this forum thread: https://ninjatrader.com/support/foru...89#post1160389

    Let me know if I may assist further.
    <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Mindset, 04-21-2026, 06:46 AM
    0 responses
    90 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by M4ndoo, 04-20-2026, 05:21 PM
    0 responses
    137 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by M4ndoo, 04-19-2026, 05:54 PM
    0 responses
    68 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by cmoran13, 04-16-2026, 01:02 PM
    0 responses
    120 views
    0 likes
    Last Post cmoran13  
    Started by PaulMohn, 04-10-2026, 11:11 AM
    0 responses
    71 views
    0 likes
    Last Post PaulMohn  
    Working...
    X