Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Super Trend For Ninja Trader Needed

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

    Thanks Marco

    If I want to trade 1 entry with 3 targets do I just comment out the entry 2 and 3?

    Thanks Again

    PS
    I just loaded the strategy and noticed that you are not able to select the target values only the 1 stop value of 20
    Last edited by geotabs; 11-29-2012, 05:29 PM.

    Comment


      If I want to trade 1 entry with 3 targets do I just comment out the entry 2 and 3?
      1 entry means enter long or short with 1 contract, so you cannot have 3 profit targets.
      If you mean enter long or short with 3 contracts at the same time each with its own profitarget, that is exactly what the latest version is supposed to do. If you want to enter with 2 contracts, you have to comment out all the "entry_3" long and short entries in the code (that would be line 98 and 110) Does that make sense ?


      I just loaded the strategy and noticed that you are not able to select the target values only the 1 stop value of 20
      And I suppose you want to get that fixed ?
      Although they are selectable by editing the values in the SetProfitTarget statements in the strategy code ( in the Initialize() method ) , I admit it is not the most elegant way.
      Please find attached an updated strategy with the profitargets user selectable in the parameters window.

      Marco
      Attached Files

      Comment


        Thanks Marco

        I have tested it out today and the order trigger works perfect, the issue I am having is that it does send out 3 septate order to buy at market, so if I have 3 contracts or 300 share for stocks it will send out 3 buy orders of 100 shares each instead of 1 order of 300 shares, for contracts it is not a problem but for commissions on stocks this would as IB is .005 per share with minimum of 1 dollar so if I wanted 900 share the commissions would be more on 3 separate orders than just 1.

        I tried modifying your original code to allow 2 targets with 1 entry but when filled still only has 1 target, can you take a look and see where I'm going wrong.

        Thanks
        Attached Files

        Comment


          As far as I know it is not possible to have 1 entry of 300 shares combined with 2 profit targets of 150 each using the default SetProfitTarget() command.

          It would be possible to create the 2 profittargets by creating 2 Limit orders with the ExitLongLimit() command. This is a rather complicated procedure, and would advice you not to follow in this early stage of your strategy. If the stratgey is profitable, those few extra dollars commission won't make a big difference on total profit, do they ?


          Marco
          Last edited by marcow; 12-01-2012, 07:33 PM.

          Comment


            I have made a new strategy with an ATM strategy for order entry, It does fill but it continues to submit orders and fills them, I have set entries per direction to 1 and tried changing entry handling to unique entry but still fires off order after order.
            I am new to programming and have attached what I have done, if anyone here could explain where I'm going wrong would really appreciate it.

            Thanks In Advance

            And Thank You Marco for all your help

            Cheers
            Attached Files

            Comment


              hello geotabs,

              I don't know very much about ATM strategies as I said before. After looking at the ATM strategy you posted I was curious of how these ATM stragties exactly worked, and started experimenting why it wasn'r working as expected.

              The problem in the ATM strategy is that it starts a new ATMstrategy over and over, because the segment in the code where the ATMStratgeyCreate is located is executed every tick if Price is above/below the green/red line. The condition is not a crossover anymore (as it was in the original SuperTrend demo) which is only executed once.
              The trick is to create boolean which you set once you've executed the ATMStratgeyCreate command , so it only gets executed once. Another thing to do is to close out any running ATMstrategies before starting a new one.
              I've also introduced a integer named "count" which advances the ATMStrategyID name with 1 for each new ATMstategy created. This way you have a "logical" new name for each ATMstrategy and not a random value as the "GetATMStartegyUniqueID" generates.

              I've attached your strategy with these changes, feel free to study the code and see how things are done. I've commented most added code for clarification.

              By the way, in my opinion you're making good progress in your programming skills.

              let me know if the strategy works.

              Marco
              Attached Files

              Comment


                Hi Marco

                It works like a charm, I'm still trying to figure what the code means but works great.
                Thanks Again
                I have been tinkering with your Supertrenddemo to add a second filter, what I was trying to do is to only have a long trade fire off if red SuperTrend line is above 50 SMA, if red SuperTrend line is below 50 SMA it will not fire off a trade and the opposite for short.
                What is doing now is if the red SuperTrend line is below 50 SMA it will wait until last price is above 50 SMA and fires off a trade when it shouldn't

                I have attached a pic also with cs file

                PS
                Also is there a site that you know of that would be like a dictionary for code so that I can start to make sense of this :
                Attached Files

                Comment


                  What is doing now is if the red SuperTrend line is below 50 SMA it will wait until last price is above 50 SMA and fires off a trade when it shouldn't
                  the code in the SuperTrendDemoSMA you posted says:

                  When condition 1 and 2 and 3 are met go long.
                  condition 1) SuperTrend indicator was short
                  condition 2) price crosses above DownTrend[0] (red line)
                  condition 3) price greater then SMA(50)

                  you made an error in the 3rd condition. You want the supertrend RED line to be above SMA(50), not the price ! So condition 3 should be:
                  condition 3) DownTrend[0] greater then SMA(50)

                  take a look at the code in the attached strategy. Here it says SMA(50) < Supertrend red line, but that is the same. It should work now.

                  Also is there a site that you know of that would be like a dictionary for code so that I can start to make sense of this
                  What I find the most helpful is to use the Strategy Builder/Wizard in NinjaTrader.
                  Don't know if you used it before, you can find it at NTcontrolPanel/Tools/newNinjascript/Strategy. Then create a very simple strategy like if Close[0] > MA(25) and press the view code button.Now you see the actual code of the strategy. Now change some parameters of the strategy in the Wizard building blocks and see the code getting updated realtime ! Try to understand what changed in the code and why it changed.

                  The NinjaTrader Help file also contains lots of code examples. Take a look at NinjaScrip/Educational Resources/Basic Programming Concepts.
                  Attached Files

                  Comment


                    within the day

                    it is possible, that the indicator calculate only intraday "within the day"? Start every day with new fresh data, dont look yesterday prices?

                    thanks in advance.

                    Comment


                      Hi...where can I download the latest and most original version?

                      Comment


                        Someone help me on accessing the value of the Elliott Wave's TSSuperTrend in a strategy? I keep on getting an error on it.

                        Comment


                          What error do you get ?
                          I assume you did read my post #346 in this thread, and installed the SuperTrendDemo.cs strategy I posted there ?

                          The SuperTrendDemo.cs strategy uses the TSSupertrend indicator, so you can look in its code how to access it.

                          Marco
                          Last edited by marcow; 04-10-2013, 12:06 PM.

                          Comment


                            Yeah I got the solution there. Thanks a lot

                            Comment


                              bettersupertrend

                              I can't stop this from firing off orders and also when i switch to renko bars the stop ticks are unconforming how do i switch to renko brick ticks. The backtest works great, any suggestions?
                              Attached Files

                              Comment


                                Hello cameo86,

                                Could you clarify how your Stop tick are "unconforming" so that I may assist you?
                                JCNinjaTrader Customer Service

                                Comment

                                Latest Posts

                                Collapse

                                Topics Statistics Last Post
                                Started by rhyminkevin, Today, 04:58 PM
                                3 responses
                                47 views
                                0 likes
                                Last Post Anfedport  
                                Started by iceman2018, Today, 05:07 PM
                                0 responses
                                5 views
                                0 likes
                                Last Post iceman2018  
                                Started by lightsun47, Today, 03:51 PM
                                0 responses
                                7 views
                                0 likes
                                Last Post lightsun47  
                                Started by 00nevest, Today, 02:27 PM
                                1 response
                                14 views
                                0 likes
                                Last Post 00nevest  
                                Started by futtrader, 04-21-2024, 01:50 AM
                                4 responses
                                50 views
                                0 likes
                                Last Post futtrader  
                                Working...
                                X