• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

SetProfitTarget() does not appear to work in SampleMACrossOver strategy.

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

    SetProfitTarget() does not appear to work in SampleMACrossOver strategy.

    I am trying to get a working knowledge of SetProfitTarget() in a working ninjascript strategy.
    I made a copy of the SampleMACrossOver strategy

    I added the following lines in OnStateChange():

    else if (State == State.Configure) {
    SetParabolicStop(CalculationMode.Ticks, 20);
    }

    In OnBarUpdate() I commented out the short order so that only long orders would be generated:

    else if (CrossBelow(smaFast, smaSlow, 1)) {
    // EnterShort();
    }

    I ran the strategy on CL 04-20 around the date 3/1/2020. Almost all of the time the strategy exited based on session close even though the stop losses were huge and the long order should have been stopped out by the Parabolic stop. Running the same strategy with a Trailing Stop of 20 ticks creates a lot of stop orders.

    I do not understand why SetParabolicStop() does not create obvious stop orders.

    #2
    Hello robertlaub,

    Are you using the settings suggested by the indicator of 0.02, 0.2, and 0.02?

    Try setting the parabolic stop to a smaller tick distance like 5.

    Do you still see that there are no exits when using these settings?
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      I mistyped in the title: "SetProfitTarget()" should have read "SetParabolicStop()".

      I attached two files. One is the script which I used called SamepleMACrossOverRob. It is a modified version of the SampleMACrossOver strategy found in the standard NT8 distribution.The second file is a pdf which shows the results of running a backtest on SamepleMACrossOverRob using the "Strategy Analyzer".

      Even though the script uses "SetParabolicStop(CalculationMode.Ticks, 60);", the backtest shows one of the trades losing over $10,000. 60 ticks on the ES is worth $750.
      Attached Files

      Comment


        #4
        Hello robertlaub,

        What is the entry price and exit price of the trade?
        Chelsea B.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by aviat72, Today, 12:41 AM
        1 response
        9 views
        0 likes
        Last Post NinjaTrader_ChrisSch  
        Started by _Zero_, 01-06-2020, 01:16 PM
        2 responses
        75 views
        2 likes
        Last Post CiprianV  
        Started by RuthB, 05-29-2020, 09:41 PM
        3 responses
        33 views
        0 likes
        Last Post aviat72
        by aviat72
         
        Started by Jorge.andres.o, Yesterday, 08:22 PM
        0 responses
        7 views
        0 likes
        Last Post Jorge.andres.o  
        Started by mtamaku, Yesterday, 06:54 PM
        0 responses
        11 views
        0 likes
        Last Post mtamaku
        by mtamaku
         
        Working...
        X