Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Open[] and StopLoss doesn't work

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

    Open[] and StopLoss doesn't work

    Hello,
    i have problems generating my strategie. I want to step out of the market on the first Open-Profit-Day-Bar once i have entered the market. Therefore i need to Point to the Bar which i have entered the market. For example if i step into the market at current bar and the next Open-Profit(!)-Day is 2 Bars later, i can't write Open[0]>Open[1]...because Open[1] is the Open-Value from the day before of the current bar..so i need to point to the bar before the bar before... How can i realise this?...Next point is, that i can see at the graph that my stoploss is not recognized. Sometimes he steps out of the market one day after i steped in, even if my stoploss has not been reached. Sometimes he steps into the market and steps out 2bars later, but the Open-Profit-Day was exactly the next bar..not the next bar after the next bar. And sometimes...ninjatrader does it well..like i want him to do it... Step into the Market..and STep out of the market on the first Open-Profit-Day... i wrote this example based on a long trade.. I am thankful for every support
    For Example if the SMA of today Open is higher than the SMA of the day before enter long and exit on the next Open-Profit-Day-Value
    Mike
    Last edited by MikeTheT; 08-20-2014, 12:42 AM.

    #2
    Thanks for the post Mike and welcome to our forums.

    Generally the code will run as coded into your conditions, there's ambiguity on NT's part here evaluating.

    What kind of stop loss are you exactly using? If SetStopLoss which mode and value for example?

    How is the exit condition defined? Would this be the first profitable day of entry and then you want to exit this day on the close of the bar?
    BertrandNinjaTrader Customer Service

    Comment


      #3
      Hello Bertrand,

      Im using SetStopLoss("", Ca..Percent, 3, true)

      No, i want to enter at the OpenValue if my conditions are true..and I want to exit the same trade at the next day Open-Value(!) which will gain profit..no matter how much profit.. if it's one point ..step out of the trade..if it's 100points..step out aswell.. when i exit the trade..i want to be able to step into again on the same day..if my conditions are again true..

      Thank you for your support!
      regards Mike

      Comment


        #4
        Hi Mike, for the stoploss if you wanted to enter 3 percent, then please change the value used to 0.03 - as otherwise your now used one will be far to high to trigger as expected.

        So you're working off daily bars here in this script?

        As for what you outline, intraday data would be needed - as otherwise for the day you would only have one data point to act on in your OnBarUpdate() method.
        BertrandNinjaTrader Customer Service

        Comment


          #5
          Ah i understand now, 100% stands for 1.0 0.03 stands for 3percent from the actual entry price? Ist it true?


          Correct, im working with daily bars..

          I don't think so Bertrand.. because when i step in on 19.08.2014 at the openvalue, because my conditions are true, an the openvalue from 20.08.2014 is higher..then i would close the long trade.. if not the trade runs until the openvalue is higher then the openentry value..i don't see a need of intraday data. EOD is all i need. If i exit my long trade..check conditions..if they are true..enter at openvalue of close-day from the trade before.. maybe you can help me.
          Thank you for the support Bertrand.
          Regards Mike
          Last edited by MikeTheT; 08-20-2014, 07:17 AM.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by algospoke, Today, 06:40 PM
          0 responses
          9 views
          0 likes
          Last Post algospoke  
          Started by maybeimnotrader, Today, 05:46 PM
          0 responses
          7 views
          0 likes
          Last Post maybeimnotrader  
          Started by quantismo, Today, 05:13 PM
          0 responses
          7 views
          0 likes
          Last Post quantismo  
          Started by AttiM, 02-14-2024, 05:20 PM
          8 responses
          168 views
          0 likes
          Last Post jeronymite  
          Started by cre8able, Today, 04:22 PM
          0 responses
          10 views
          0 likes
          Last Post cre8able  
          Working...
          X