Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

I need my code critiqued (Please help me LEARN!)

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

    I need my code critiqued (Please help me LEARN!)

    Hi,
    I'm new to the forum. I'm an entry level C# developer and novice trader. I've been using NT for almost a week now. I'd like you guys to please take a look at this code I've written and point out all of the unnecessary variables, method calls, etc...that I have in here but please don't provide any source code for me. I'm trying to learn how to write good code so I don't want anyone to provide me with the solution I need to figure out how to write it myself.

    This strategy goes long if the underlying hits a n-period high and has a range expansion greater than x-periods ago. It goes short under the same circumstances but the only difference is a n-period low.

    So, would you please point out the correct way this should be wrote? I also haven't figured out which NT method to use to establish long/short positions accompanied with trailing stops...will some please point in the right direction?


    Help me LEARN!
    Attached Files

    #2
    d.allen101,

    To attach a trailing stop please use SetTrailStop().
    Josh P.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    68 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    41 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    24 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    27 views
    0 likes
    Last Post TheRealMorford  
    Started by Mindset, 02-28-2026, 06:16 AM
    0 responses
    54 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Working...
    X