Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Pop up window

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

    #16
    You can use GetProfitLoss() Peter for this task - http://www.ninjatrader.com/support/h...profitloss.htm

    Comment


      #17
      Thank you Bertrand,

      Do you know where I can find example of entering 2 lots with 1st lot taking profit after certain number of pips and the second contract as the runner controled by other criteria (like following the MA).

      Thanks again
      Peter

      Comment


        #18
        Peter, unfortunately I'm not aware of an exact script for this use, but for example the Verwoort strategy in our sharing does scale out with 1 short target and a more 'runner like' one so you can take it as a start - http://www.ninjatrader.com/support/f...N&pp=15&page=2

        Comment


          #19
          Thank you Bernard for helping me,

          Another question is if there script to calculate the distance of price from Bolinger band top or bottom MA. Or distance between the lines of BB

          Thanks
          Peter

          Comment


            #20
            You're welcome, yes there are several %B variations floating around here - http://www.ninjatrader.com/support/f...llinger&desc=1

            Comment


              #21
              Hi Bernard,

              Thanks for replays.
              When I use backtest and I have negative value (EXAMPLE -10) integer , I have on Strategy Analyzer value of 1. It should be -10 because I initiated Variable with -10 in
              #region
              Variables.

              How can I get around it?

              Thanks
              peter

              Comment


                #22
                Hi Bertrand,
                I am thinking to use new variable integer.I can Transfer negative value from indicator. In Strategy I would like to recognize that this value is negative . I dont know how to recognize that value is negative.
                Once I recognized its negative I can change it to positive. Again do you know where can I find example?
                This positive value I can compaire with positive numbers. This way I can now back tested the strategy.

                Thanks
                peter

                Originally posted by Peter88 View Post
                Hi Bernard,

                Thanks for replays.
                When I use backtest and I have negative value (EXAMPLE -10) integer , I have on Strategy Analyzer value of 1. It should be -10 because I initiated Variable with -10 in
                #region
                Variables.

                How can I get around it?

                Thanks
                peter

                Comment


                  #23
                  Peter, if this issue is with a user defined int input, please ensure the min value you've decided to set it up with extends to negative numbers as well.

                  Comment


                    #24
                    Hi Bertrand,

                    Thanks for replay.
                    Are you saying that we can backtest negative numbers in Strategy Analyzer?
                    When I try to test on SIm live the same strategy shows green color for some instrument and yellow color on others. This is in control center-Strategies ,highlight on individual strategies under Strategy.Is there explanation why is highlight different?

                    thanks
                    peter

                    Comment


                      #25
                      Peter, for the different strategy states you noticed in the Strategies tab, please have a look here -



                      Green highlighted "Strategy" cell indicates a currently running strategy.

                      Yellow highlighted "Strategy" cell indicates the strategy is waiting until it reaches a flat position to be in sync with the account position before fully starting. (Please see the options Strategies Tab section for configuration options)

                      White highlighted "Strategy" cell indicates a disabled strategy.
                      What do you mean by testing negative values? A user input for a strategy could be negative as well, it would be limited by the variable chosen only - bool's would be true / false, int would contain integer numbers only, while doubles could offer a precision up to 16 digits.

                      Comment


                        #26
                        Thanks Bertrand,

                        Testing negative value : I want to test values like -1, -20, -100 which I get from indicator.This -value I would like to analyze in Strategy and the test it in Backtest.

                        thanks
                        peter
                        Originally posted by NinjaTrader_Bertrand View Post
                        Peter, for the different strategy states you noticed in the Strategies tab, please have a look here -





                        What do you mean by testing negative values? A user input for a strategy could be negative as well, it would be limited by the variable chosen only - bool's would be true / false, int would contain integer numbers only, while doubles could offer a precision up to 16 digits.

                        Comment


                          #27
                          Yes, values returned from indicators could be negative as well - you would need to ensure to use the correct indicator plot in your conditions to work with it - http://www.ninjatrader.com/support/h...on_builder.htm

                          Comment


                            #28
                            Hi Bertrand,

                            I can get negative values from indicator to Strategy, but I cannot make it test in Strategy tester |backtest. Are you sure we can use negative values in Strategy Tester for backtest?

                            thanks
                            peter

                            Comment


                              #29
                              Peter, can you please post screenshots of your user defined inputs and conditions of the strategy, so we can take a look?

                              Thanks,

                              Comment


                                #30
                                Hi Bertrand,

                                For now I stop playing with negative values. Its over my head. Before I post spme pictures I will need to learn how to do it.
                                For now I just play with existing strategies and indicator and learning how scripts works.
                                I wanted to ask you if there is exit script which follow some indicator. What I mean is trailing stop which follow the price and takes values from indicator (like moving average).
                                When I tested existing strategies I can see that Optimazetion will make choise of making average of the trades and pick up SL,TP and TS based on criteria. Its actually misleading. Cutting some good trades in the midlle of action.

                                Thanks
                                Peter

                                Comment

                                Latest Posts

                                Collapse

                                Topics Statistics Last Post
                                Started by argusthome, 03-08-2026, 10:06 AM
                                0 responses
                                85 views
                                0 likes
                                Last Post argusthome  
                                Started by NabilKhattabi, 03-06-2026, 11:18 AM
                                0 responses
                                47 views
                                0 likes
                                Last Post NabilKhattabi  
                                Started by Deep42, 03-06-2026, 12:28 AM
                                0 responses
                                29 views
                                0 likes
                                Last Post Deep42
                                by Deep42
                                 
                                Started by TheRealMorford, 03-05-2026, 06:15 PM
                                0 responses
                                32 views
                                0 likes
                                Last Post TheRealMorford  
                                Started by Mindset, 02-28-2026, 06:16 AM
                                0 responses
                                67 views
                                0 likes
                                Last Post Mindset
                                by Mindset
                                 
                                Working...
                                X