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 CarlTrading, Yesterday, 11:51 AM
    0 responses
    19 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, Yesterday, 11:48 AM
    0 responses
    23 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 03-25-2026, 09:53 PM
    0 responses
    30 views
    0 likes
    Last Post CaptainJack  
    Started by CaptainJack, 03-25-2026, 09:51 PM
    0 responses
    18 views
    0 likes
    Last Post CaptainJack  
    Started by Mindset, 03-23-2026, 11:13 AM
    0 responses
    23 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Working...
    X