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

Simple MacD Cross Over

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

    Simple MacD Cross Over

    I created a simple MacD cross over strategy - cross above go short - cross below go long.

    At the last screen in the strategy wizard I set a profit of 10 ticks and a stop loss of ten ticks.

    When it actually runs it enters and exits based on the MacD cross over and not by the profit or stop loss (seems to be ignoring the profit and stop loss part.

    Any suggestions?

    Thanks.
    Attached Files

    #2
    Hello,

    Thank you for writing in.

    When using the Strategy builder, SetProfitTarget() and SetStopLoss() get placed in Initialize(). This results in static profit targets and stop losses that are based on the entry price alone. If you unlock the code, these calls may be moved to OnBarUpdate() to dynamically change them depending on your chosen logic.

    When you are enabling your strategy, are you using PerEntryExecution or ByStrategyPosition?

    Please see here for more information on the managed approach to submitting orders:


    If you would like further assistance, could you include the .cs for your strategy so I may reproduce it on my end?
    JimNinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_Jim View Post
      Hello,

      Thank you for writing in.

      When using the Strategy builder, SetProfitTarget() and SetStopLoss() get placed in Initialize(). This results in static profit targets and stop losses that are based on the entry price alone. If you unlock the code, these calls may be moved to OnBarUpdate() to dynamically change them depending on your chosen logic.

      When you are enabling your strategy, are you using PerEntryExecution or ByStrategyPosition?

      Please see here for more information on the managed approach to submitting orders:


      If you would like further assistance, could you include the .cs for your strategy so I may reproduce it on my end?
      Thank you Jim. Merry Christmas.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by timmbbo, Today, 08:59 AM
      0 responses
      1 view
      0 likes
      Last Post timmbbo
      by timmbbo
       
      Started by bmartz, 03-12-2024, 06:12 AM
      5 responses
      33 views
      0 likes
      Last Post NinjaTrader_Zachary  
      Started by Aviram Y, Today, 05:29 AM
      4 responses
      14 views
      0 likes
      Last Post Aviram Y  
      Started by algospoke, 04-17-2024, 06:40 PM
      3 responses
      28 views
      0 likes
      Last Post NinjaTrader_Jesse  
      Started by gentlebenthebear, Today, 01:30 AM
      1 response
      8 views
      0 likes
      Last Post NinjaTrader_Jesse  
      Working...
      X