Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Stopping out at entry price

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

    Stopping out at entry price

    I am new to Ninja Trader strategy building, and I wanted to delay having to learn the details of coding so I used the wizard to build a simple strategy. I defined variables caled "T1" and "StopLE" in my variable definition screen, then creaeted a simple condition, then in the "stops and targets" screen I defined my target as variable "T1" and my stop as variable "StopLE". For target I used "mode = ticks" which I thought meant that if the market moved "T1" ticks from entry I would exit the position. Similarly I used "mode=ticks" for the stop definition which I thought meant that if the market moved against me "StopLE" ticks I would exit the position. I chose the value of 8 for T1 and -6 for StopLE (I also tried +6 earlier but had the same results as I report below). When I run the strategy my entries are fine, but it exits the position immediately at the entry price. What am I doing wrong?
    Thanks for the help.
    Ron

    #2
    I posted below about my stoploss triggiring as soon as the trade was entered. but now is seems to be mostly working (I refreshed the chart). But I still have some questions.

    1. I have a variable called StopLE which is want to use to input how many ticks to have for my stoploss on a long entry. When I try to define this as an integer I get an error message when compiling: "cannot implicitly convert type "double" to "integer"..." Since I'm describing ticks I thought that integer would be a better type of varialbe to use--why can't I do this. Once I switch the varialbe type back to double I don't see those error messages anymore.

    2. If using the Wizard for adding stop loss or targets and mode = "ticks" does the strategy know that short entries want entry price +#ticks for stoploss and long entries want entry price -#ticks? Also if I want to specify a specific entry with a specific stop loss (for instance if I need to specify negative ticks for long entries and positive ticks for short entry) how do I do this? It seems that now my short trades are stopping out properly while my long trades are stopping out as soon as the market goes at all lower from the entry. I'm using the same variable to define the stoploss in both cases. But targets for both long and short entries appear to be working even though I'm using the same variable to define the target for both long and short entries. I'm not quite understanding what's going on.

    3. If I want to scale out with 2 targets how do I specify one target for the first postiion and the other target for the second?

    Thank you very much.
    Ron

    Comment


      #3
      Hello,

      1. I have a variable called StopLE which is want to use to input how many ticks to have for my stoploss on a long entry. When I try to define this as an integer I get an error message when compiling: "cannot implicitly convert type "double" to "integer"..." Since I'm describing ticks I thought that integer would be a better type of varialbe to use--why can't I do this. Once I switch the varialbe type back to double I don't see those error messages anymore.
      >>Keep it as a double if the resolves the error. However I would have to see your code or a screen shot of your Conditions and Actions window to help you further. This error occurs when two variables are used but they are different data types.

      2. If using the Wizard for adding stop loss or targets and mode = "ticks" does the strategy know that short entries want entry price +#ticks for stoploss and long entries want entry price -#ticks? Also if I want to specify a specific entry with a specific stop loss (for instance if I need to specify negative ticks for long entries and positive ticks for short entry) how do I do this? It seems that now my short trades are stopping out properly while my long trades are stopping out as soon as the market goes at all lower from the entry. I'm using the same variable to define the stoploss in both cases. But targets for both long and short entries appear to be working even though I'm using the same variable to define the target for both long and short entries. I'm not quite understanding what's going on.
      >>If you have them linked together with and entry signal name, yes it will know. Just make sure the entry signal names are the same on both the target and stops area and the actions/orders area.

      3. If I want to scale out with 2 targets how do I specify one target for the first postiion and the other target for the second?
      >>Create different entries and have them linked with different signal names.
      This link may help:
      DenNinjaTrader Customer Service

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      558 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      324 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      101 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      545 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      547 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X