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 NullPointStrategies, Yesterday, 05:17 AM
    0 responses
    66 views
    0 likes
    Last Post NullPointStrategies  
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    141 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    76 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    47 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    51 views
    0 likes
    Last Post TheRealMorford  
    Working...
    X