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

trouble with spot losses

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

    trouble with spot losses

    Dear friends.
    I have set up. Stop loss and teke profit
    SetStopLoss(400);
    SetProfitTarget(1500);

    But size of stop loss changing in high range, from 300 usd to 2000. How can I fix this?

    #2
    I have attached list of my trades
    Attached Files

    Comment


      #3
      daglas, what timeframe / chart are those trades placed on? Are those backtested results you run through?
      BertrandNinjaTrader Customer Service

      Comment


        #4
        it's 15-20 pips range bars. It's not back test, it's live trading on demo account.

        Comment


          #5
          Thanks, did you set those stop losses to be simulated in code, so NT would wait until price triggered the stop and then send a market order?
          BertrandNinjaTrader Customer Service

          Comment


            #6
            how can I do such settings? to simulate stop losses in code.

            Comment


              #7
              You would set the simulated parameter to 'true' in the SetStopLoss() call.

              BertrandNinjaTrader Customer Service

              Comment


                #8
                Originally posted by NinjaTrader_Bertrand View Post
                You would set the simulated parameter to 'true' in the SetStopLoss() call.

                http://www.ninjatrader.com/support/h...etstoploss.htm
                Thanks I shall try this.
                I have modify my strategy. And collecting results of trading. Also I want to ask you about take profit size. It has different size in trades to. How I can fix size of take profit?
                As I see it has not simulation mode.

                Comment


                  #9
                  Hello,

                  Just to make sure we are on the same page to you mean by size the order QTY is different or the distance from the entry price to the stop loss/ profit target price is different?

                  -Brett

                  Comment


                    #10
                    Originally posted by NinjaTrader_Brett View Post
                    Hello,

                    Just to make sure we are on the same page to you mean by size the order QTY is different or the distance from the entry price to the stop loss/ profit target price is different?

                    -Brett
                    I have set take profit in currency. QTY of trades are different, but take profit is differ too.
                    I have set up take profit at 1500 dollars, and I have take profits for trades from 30-500 usd.
                    Please check previously attached file with trades list.

                    Comment


                      #11
                      What size would you like the take profit to be? Can you please post a snippet of the code you are using for your profit?
                      MatthewNinjaTrader Product Management

                      Comment


                        #12
                        protected override void Initialize()
                        {
                        CalculateOnBarClose = true;
                        SetStopLoss(400,true);
                        SetProfitTarget(1500);

                        }

                        Comment


                          #13
                          When using SetProfitTarget, the qty will be based off the position size.

                          If you wanted to specify the qty, you would need to use a limit order with ExitLongLimit or ExitShortLimit:

                          MatthewNinjaTrader Product Management

                          Comment


                            #14
                            Originally posted by NinjaTrader_Matthew View Post
                            When using SetProfitTarget, the qty will be based off the position size.

                            If you wanted to specify the qty, you would need to use a limit order with ExitLongLimit or ExitShortLimit:

                            http://www.ninjatrader.com/support/h...tlonglimit.htm
                            Thanks. I shall try using fixed lot size (1 contract). And I shall check take profit size.

                            Comment


                              #15
                              I have troubles with stop loses and take profits.
                              I have attached list of my trades. Some times take profits and stop loses did not work.
                              I have create a code for closing positions with market orders. But this code did not work at some time frame. I shall post this code next time.
                              Attached Files

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by bortz, 11-06-2023, 08:04 AM
                              47 responses
                              1,608 views
                              0 likes
                              Last Post aligator  
                              Started by jaybedreamin, Today, 05:56 PM
                              0 responses
                              9 views
                              0 likes
                              Last Post jaybedreamin  
                              Started by DJ888, 04-16-2024, 06:09 PM
                              6 responses
                              19 views
                              0 likes
                              Last Post DJ888
                              by DJ888
                               
                              Started by Jon17, Today, 04:33 PM
                              0 responses
                              6 views
                              0 likes
                              Last Post Jon17
                              by Jon17
                               
                              Started by Javierw.ok, Today, 04:12 PM
                              0 responses
                              16 views
                              0 likes
                              Last Post Javierw.ok  
                              Working...
                              X