Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Strategy Wizard Help

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

    #16
    Hello guidoisot,

    Thanks for your post and persistence in striving to your goals.

    So that I can better assist you, please post a screenshot or two of what the strategy is currently doing with comments about what you would like it to do. It will help to also note the instrument and timeframe so I might replicate what you are seeing.

    Comment


      #17
      Hello Paul,
      thank you for your help.
      I attach some screenshots showing some execution (mostly unwanted ones). If possible I can also send a 5 min .flv video (70MB) of its backtesting.
      Please let me know if this may be adequate for showing how this "would-be-DetachCross" works.
      Clearly it is not doing what it is supposed to do.
      I think this is due to the fact that it not 100% clear to me how the bar counter function works.
      Thank you very much again.
      best regards,
      Guido.
      Attached Files
      Last edited by guidoisot; 12-28-2015, 04:18 PM.

      Comment


        #18
        Hello guidoisot,

        Thanks for your post and pictures.

        In a quick review of your code i note that this section of code is incorrect:

        if(MAX(UltimateOscillator(7, 14, 28), MinMaxPeriod)[0] <= MAX(UltimateOscillator(7, 14, 28), MinMaxPeriod)[1])
        {
        // Condition set 7.2
        if (CrossBelow(UltimateOscillator(7, 14, 28), SMA(UltimateOscillator(7, 14, 28), SmaPeriod), 1)
        && CurrentBar - minLineBarNum <= DistanceCross)
        {
        EnterShort();
        }
        }
        else //MAX line is still being pushed up
        {
        maxLineBarNum = CurrentBar;
        }

        I believe that you want to use the variable maxLineBarNum in the statement: && CurrentBar - minLineBarNum <= DistanceCross)

        Comment


          #19
          some progress in strategy example

          Hello Paul,
          thank you very much again for your support in developing this scripting exercise.
          I have added a condition to each one of the two nested “if”, so that trades are executed only when MIN and MAX lines still have the same value of when the oscillator started to detach from either one of them.
          It looks like this new condition makes the script working ok.
          I have added an indicator valueSlopeFisherRSI200 I wrote (always thanks to the very helpful support and guidance of NinjaTrader Support) couple of months ago. This indicator should … be equal to 1 when trend is up, equal to -1 when trend is down; up and down is supposed to be measured via the reciprocal crossovers of two long term RSI, one having a much higher smooth than the other one.
          I would like to carry on in developing this script, which so far has been a good learning tool/opportunity for me and I hope perhaps also for other forum members, by adding a couple a features which I have indicated into the text of the attached .cs file.
          The first two features I am thinking about are copied herebelow:
          1) Stops management:
          // quick backtesting shows that trailingstop and stoploss do not actually work together, only either one of the 2 prevails, I cannot see why
          // an interesting option, to add here and test, would be having a variable trailing stop,
          // trailing stop should be a decreasing(?) function of unrealized profit, and it should activate only after a minimum TargetProfit is reached
          // 2) possibility to select different oscillators (for ex from a list in a leftclick drop down selection window):
          // here this example has been built around the UltimateOscillator an interesting option could be generalize the oscillator under consideration
          // and having the possibility of replacing it (TrueStrenghtIndex, MACD, ....)

          Thank you in advance to anyone sharing any useful tip/assistance on how to proceed in the implementation of these additional features.
          Best.
          Guidoisot.
          Attached Files
          Last edited by guidoisot; 12-30-2015, 10:25 AM.

          Comment


            #20
            Hello guidoisot,

            Thanks for your post.

            Please note that if you need to post further that you should start a new thread in the correct forum as this is no longer (and hasn't been) related to the strategy wizard. Also the thread originator is probably getting tired of all the e-mail notifications that are not related to his original query!

            To briefly respond:

            Please make sure you are reviewing the helpguide on these Set methods, please see: http://ninjatrader.com/support/helpG...ttrailstop.htm Specifically the tips section that advises, "The SetTrailStop() method can NOT be used concurrently with the SetStopLoss() method for the same position, if both methods are called for the same position (fromEntrySignal) the SetStopLoss() will always take precedence. You can however, use both methods in the same strategy if they reference different signal names."

            The Ninjatrader SetTrailStop() will only trail X ticks or percent as defined. You can code your own trail stop in any way you wish.

            Here is a link to an example of selecting different moving average types that should show you what you would need to do for selecting different oscillators: http://ninjatrader.com/support/forum...ead.php?t=3420

            If you need custom development assistance we can certainly refer you to a list of Ecosystem developers.

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Geovanny Suaza, 02-11-2026, 06:32 PM
            0 responses
            630 views
            0 likes
            Last Post Geovanny Suaza  
            Started by Geovanny Suaza, 02-11-2026, 05:51 PM
            0 responses
            364 views
            1 like
            Last Post Geovanny Suaza  
            Started by Mindset, 02-09-2026, 11:44 AM
            0 responses
            105 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Started by Geovanny Suaza, 02-02-2026, 12:30 PM
            0 responses
            564 views
            1 like
            Last Post Geovanny Suaza  
            Started by RFrosty, 01-28-2026, 06:49 PM
            0 responses
            568 views
            1 like
            Last Post RFrosty
            by RFrosty
             
            Working...
            X