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

very simple question, nt support should definitely be able to assist w/ this request.

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

    very simple question, nt support should definitely be able to assist w/ this request.






    people with nt,


    the properties and using regions and the nt generated code section are some of the most unattractive and frustrating elements for non programmers like myself when working with nt.


    i have a strategy which uses a stop loss order for every position and then adjusts it to a break even stop order if price is made to move in my favor. i am refining this strategy and there are times when i would want the adjusted stop loss order to still be at a negative distance to the entry price but there are also situations when i want to test if it would be better to move this stop to a profitable position.

    therefore, i would like to have a fragment of code like the one below that could work with both negative and positive values. ¿how can i change the range in this fragment so that it is not restricted to positive values only?


    [NinjaScriptProperty]
    [Range(1, int.MaxValue)]
    [Display(Name="", Description="", Order=, GroupName="Parameters")]
    public int
    { get; set; }



    very well, regards.

    #2
    Hi rtwave thanks for posting.

    You can use int.MinValue instead of 1 to allow negative numbers:
    [Range(int.MinValue, int.MaxValue)]

    Best regards,
    -ChrisL
    Chris L.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by pechtri, 06-22-2023, 02:31 AM
    9 responses
    122 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by frankthearm, 04-18-2024, 09:08 AM
    16 responses
    66 views
    0 likes
    Last Post NinjaTrader_Clayton  
    Started by habeebft, Today, 01:18 PM
    1 response
    5 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by benmarkal, Today, 12:52 PM
    2 responses
    14 views
    0 likes
    Last Post benmarkal  
    Started by f.saeidi, Today, 01:38 PM
    1 response
    8 views
    0 likes
    Last Post NinjaTrader_BrandonH  
    Working...
    X