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

New User Woes

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

    #16
    Originally posted by timmyb View Post
    So far so good everything is ok but a couple more questions:

    When bactesting can i use recorded data??

    I find that the backtesting is bad for my strategy but in live trading seems to do well.

    I have a ma crossover and for some reason when it goes short it covers my long then goes short two contracts. I am thinking becuse it gets confused on the long cover.

    Any input is great

    Thanks guys

    Tim
    1) No
    2) You would need to debug your strategy. The SamplMACrossover strategy is reference you can use. If this strategy doubled up on a cross, then there likely is a problem on our end.
    RayNinjaTrader Customer Service

    Comment


      #17
      Thank you ninja ray, you have been an unbeleivable help in the learning curve.

      A few more

      Is there a way to stop a strategy at acertain gain or loss

      IE with strategy runner i used to have, I could stop the days trading at a certain loss or gain on the whole day. Like if i made 500 it will stop all trading etc.

      Thanks again for all the help guys and gals, and yes i am diggin through the forums etc trying to find my answers also.

      Tim

      Comment


        #18
        Yes this is possible but you would have to program it.

        Here is a reference sample - http://www.ninjatrader-support.com/v...ead.php?t=4084
        RayNinjaTrader Customer Service

        Comment


          #19
          Thank you I read the code and uderstand what it does and what you are saying.

          the only question i have is with the code:

          /* Prevents further trading if the current session's realized profit exceeds $1000 or if realized losses exceed $400.
          Also prevent trading if 10 trades have already been made in this session. */
          if (Performance.AllTrades.TradesPerformance.Currency. CumProfit - priorTradesCumProfit >= 1000
          || Performance.AllTrades.TradesPerformance.Currency.C umProfit - priorTradesCumProfit <= -400
          || Performance.AllTrades.Count - priorTradesCount > 10)

          I would assume current session would be the day, or say I turned the program on then shut down and turned back on later in the day, Would this reset or is it a timeframe like 24 hr period??

          Thanks again, I cant belive the help I have gotten

          You guys deserve soem gratitude to all us newbies on the paltform.

          Comment


            #20
            Performance stats are based on the life of the strategy. If in the reference sample trades were only taken on real-time data (not historical) then it would refer to the entire time the strategy was running. Meaning, once it reached these PnL levels.

            You will really have to dig in your self and code/test to get a better understanding of how all this works.
            RayNinjaTrader Customer Service

            Comment


              #21
              MACD Strategy Wizard

              Can i do a MACD strategy in the wizard or only code??

              what i want is the cross of the lines.

              And i realize dumb questions, probably from staring at ninja all day, but which line is what. I think the purple is the signal and the green the macd.

              Mainly what do i use in the wizard to show the cross. it seems to have the whole macd cross the whole macd.

              Thanks

              Tim

              Comment


                #22
                Yes, you can use the wizard.
                RayNinjaTrader Customer Service

                Comment


                  #23
                  figured it out , thanks again for the help ninja ray. got it all working now. those brain freezes are hard to figure out some times.

                  Thanks
                  Tim

                  Comment


                    #24
                    Really gettin things goin now, Few more questions:

                    1) I attempted to use the"bars since exit" > 4 in the wizard and it basically shut down my system and created no trades in the backtest.

                    What i wanted was that after a trade it must wait so many bars to make it look for another trade.

                    2) I am still having trouble with it going short 2 contracts instead of 1. It seems that when it sells the first to close posisiton it sells, then goes short another. Either that or it is not realizeing it exited the long, So it then goes short one contract with the exit long , and anohter with the enter short.

                    3) Under the set 1 i have the long entry, set 2 the long exit, set3 the short entry, set4 the short exit, The long exit and short entry are the same criteria so maybe this is leading to my issues. Would it be better to have two seperate strategies running, 1 for long and 1 for short?? so it wont get confused inside the same strategy. I figure if i can get the bars since exit working it may fix this issue also.


                    Tim

                    Comment


                      #25
                      Also when the 2 short occures it says order canceled. If this matters

                      Comment


                        #26
                        When two strategies are running does NT know the difference between the two, or will it get confused betweent he different trades.

                        Is there a way to have ti enter when a cross cross by so much?? IE to eliminate the touches that cause a bad signal.


                        Thanks again tim

                        Comment


                          #27
                          Running two strategies will work fine since they are independant of one another. All other issues I will advise that you need just try things and see what happens to gain an understanding...Basically, what you are doing already
                          RayNinjaTrader Customer Service

                          Comment


                            #28
                            Thank you again ninja ray.

                            But what about my double shorts? Do you think it is my strategy??

                            I will continue to strive to get the kinks worked out.

                            Thank you all for the help

                            So far the strategy has gained 8 points today on the ES with no loss yet, so i must be doing something right.


                            Thanks for helping with all the kiinks


                            Tim

                            Comment


                              #29
                              Yes I suspect it is your strategy.
                              RayNinjaTrader Customer Service

                              Comment


                                #30
                                Ok will work on that,

                                What about the code in the wizard for "bars since exit"


                                i chose that then ">" then "4"

                                it was my feeling that if more than 4 bars have passed since exit it is allowed to trade again.

                                When i put that criteria and bactested it no long traded, as in no trades happened compared to like 400 trades without it.

                                Comment

                                Latest Posts

                                Collapse

                                Topics Statistics Last Post
                                Started by Waxavi, 04-19-2024, 02:10 AM
                                2 responses
                                37 views
                                0 likes
                                Last Post poeds
                                by poeds
                                 
                                Started by chbruno, Yesterday, 04:10 PM
                                1 response
                                44 views
                                0 likes
                                Last Post NinjaTrader_Gaby  
                                Started by Max238, Today, 01:28 AM
                                1 response
                                24 views
                                0 likes
                                Last Post CactusMan  
                                Started by giulyko00, Yesterday, 12:03 PM
                                2 responses
                                10 views
                                0 likes
                                Last Post giulyko00  
                                Started by r68cervera, Today, 05:29 AM
                                0 responses
                                4 views
                                0 likes
                                Last Post r68cervera  
                                Working...
                                X