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

Profit taken

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

    Profit taken

    Hi
    this might seem impossible. I want to set so if I have like 10 point gain or more, my least point gain is 10 point.

    I know you might say set trail stop but I don't want it to work like that. I want it to keep trading until I hit my selling point by using some indicator. But say if it gain 50 points but it won't sell, I want to make sure I would at least capture 10 point gain.

    Basically when I play 5m timeframe, by the time my bot sell, it wait till next candle and it can be late.

    Thank you

    #2
    Hello, thanks for posting.

    The best way to do that would be a SetTrailStop which will stay x ticks behind the market price. If you wanted some other behavior you would need to implement custom order movement logic with ExitLongLimt/ExitShortLimit. You can use the ChangeOrder method to change the order to the desired price level:



    Best regards,
    -ChrisL
    Chris L.NinjaTrader Customer Service

    Comment


      #3
      Ahh I was wonder what are those are for. Lol thank you.

      One question if you can help me. I set a trading time from 930am to 330pm and it work great. But when I set 7pm to 8am, I won't trade, im I doing something wrong?

      Comment


        #4
        Hi, thanks for your reply.

        If you add a Print method within your condition you can check if the condition is being reached e.g.

        if(<time fileter condition>)
        {

        Print("Making Trade");
        EnterLong();

        }

        Using Print methods should be a common part of the debugging process of all scripts:


        Best regards,
        -ChrisL
        Chris L.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Rapine Heihei, Yesterday, 07:51 PM
        1 response
        12 views
        0 likes
        Last Post NinjaTrader_Gaby  
        Started by kaywai, Today, 06:26 AM
        1 response
        6 views
        0 likes
        Last Post kaywai
        by kaywai
         
        Started by ct, 05-07-2023, 12:31 PM
        6 responses
        205 views
        0 likes
        Last Post wisconsinpat  
        Started by kevinenergy, 02-17-2023, 12:42 PM
        118 responses
        2,780 views
        1 like
        Last Post kevinenergy  
        Started by briansaul, Today, 05:31 AM
        0 responses
        10 views
        0 likes
        Last Post briansaul  
        Working...
        X