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

problem with profit target

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

    problem with profit target

    I have a simple strategy I made with the wizard, but when I backtest it, instead of adding the profit target to the entry price, it uses the target price as the exit price. I have no user defined inputs.
    The condition is HeikenAshi().HAClose[0]>HeikenAshi().HAClose[1] + 0.001
    The action is Enter Long(DefaultQuantity,"")
    The profit target is
    SetProfitTarget("",CalculationMode.Price, 0.001) There is no stop loss.
    I ran this on eur.usd with stock settings except I used a 30 min chart. I had 17 trades each with a profit of -99.92% and a cumulative profit of -100% When I checked the executions It would buy at 1.3116 and sell at .0010. When I looked at the chart, most of my entries should have exited at a profit. I must be doing something wrong. Any comments?

    #2
    Hello snotrag12,

    Welcome to the NinjaTrader Support Forums!

    When using SetProfitTarget() and using the CalculationMode.Price it will be an absolute price, so when it is set to "0.001" is going to set your Profit Target at that Price so that is why it is filled at "0.0010" price..

    If you wanted to have "0.0010" Profit you may want to use CalculationMode.Ticks as it will be a number of ticks away from your Entry Price. For example: "SetProfitTarget("". CalculationMode.Ticks, 10).

    This will put the Profit Target 10 ticks above your entry price or a price value of "0.0010".
    JCNinjaTrader Customer Service

    Comment


      #3
      Hi, JC
      Thanks for your help. It works much better that way!

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by chemo, Today, 12:05 PM
      0 responses
      0 views
      0 likes
      Last Post chemo
      by chemo
       
      Started by DawnTreader, 05-08-2024, 05:58 PM
      12 responses
      41 views
      0 likes
      Last Post DawnTreader  
      Started by sofortune, Today, 10:28 AM
      4 responses
      11 views
      0 likes
      Last Post sofortune  
      Started by Haiasi, 04-25-2024, 06:53 PM
      6 responses
      82 views
      0 likes
      Last Post joselube001  
      Started by gaz0001, Today, 10:09 AM
      1 response
      7 views
      0 likes
      Last Post Red_70
      by Red_70
       
      Working...
      X