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

TASC ThreeIndicatorTrading Strategy

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

    TASC ThreeIndicatorTrading Strategy

    As I continue to learn automated strategy use - after all these years - I have downloaded the TASC strategy from this forum as per the title. It runs and tests fine historically, but running live on a sim account, gives the error in the attached screenshots. Since taking the screenshot of the strat inputs, I have added a tick buffer to both long & short order of 50 (using Ger30, so only the equivalent of 1 tick on FDAX), but this makes no difference.

    The question is simply as to why the strat is placing the stop order below the market ? Is it doing so and therefore the error msg is correct OR is it not doing so and therefore the error msg is incorrect !? Whilst I use mainly non-time based bars, I have exactly the same result using minute bars.

    I see this issue has been queried before this year without resolution.
    Attached Files

    #2
    Hello jtrade,

    Thanks for opening the thread.

    The strategy was written for use with daily bars. Additional functionality would have to be added so the strategy works well with different time frames and bar types.

    You can add prints to the logic and test it using a tool like the Playback Connection with Market Replay data to have it tell you why a certain action has occurred. Market Replay data can mimic realtime data to test NinjaScripts.

    For example, you can add the following prints with TraceOrders enabled to find out why the strategy has placed the order on the other side of the market.

    Code:
    [B]Print("");
    Print("Close[0]: " + Close[0]);
    Print("ema1[0]: " + ema1[0]);
    Print("Close[0] > ema1[0]: " + (Close[0] > ema1[0]).ToString());
    Print("smaUp[0] + TickBreakLong * TickSize: " + (smaUp[0] + TickBreakLong * TickSize).ToString());[/B]
    
    if(Close[0] > ema1[0]
    	&& Position.MarketPosition == MarketPosition.Flat)
    {
    	EnterLongStopMarket(smaUp[0] + TickBreakLong * TickSize);
    	SetStopLoss(CalculationMode.Price, smaDn[0]);
    }
    With the information received from debugging, you can then modify the strategy logic so it no longer places the order on the other side of the market, or you can add logic to the strategy to handle order rejections and take a certain action (like placing a market order instead.)

    I've included some publicly available resources on debugging NinjaScripts and handling order order rejections with RealtimeErrorHandling and OnOrderUpdate().

    Debugging - https://ninjatrader.com/support/foru...ead.php?t=3418

    Trace Orders - https://ninjatrader.com/support/foru...ead.php?t=3627

    RealtimeErrorHandling - https://ninjatrader.com/support/help...orhandling.htm

    OnOrderUpdate() - https://ninjatrader.com/support/help...rderupdate.htm

    Please let me know if I may be of further assistance.
    JimNinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_Jim View Post
      The strategy was written for use with daily bars. Additional functionality would have to be added so the strategy works well with different time frames and bar types.

      You can add prints to the logic and test it using a tool like the Playback Connection with Market Replay data to have it tell you why a certain action has occurred. Market Replay data can mimic realtime data to test NinjaScripts..
      Thanks, Jim - for a non-programmer, the question is "Surely a bar opens and closes,day, hour or minute ?"

      Originally posted by NinjaTrader_Jim View Post
      With the information received from debugging, you can then modify the strategy logic so it no longer places the order on the other side of the market, or you can add logic to the strategy to handle order rejections and take a certain action (like placing a market order instead.)

      I've included some publicly available resources on debugging NinjaScripts and handling order order rejections with RealtimeErrorHandling and OnOrderUpdate().
      .
      This is a bit like saying "If you learn Swahili (as a proxy for programming), you can enjoy the full functionality of Ninjatrader."

      Nothing personal - I seem to be in the mood for a morning rant - but none of the bank traders I know can program, they do what they are paid to do, which is trade.

      Retail trading program advertising - not only by Ninjatrader - is very misleading in this respect.

      Rant over

      Comment


        #4
        Originally posted by NinjaTrader_Jim View Post
        The strategy was written for use with daily bars. Additional functionality would have to be added so the strategy works well with different time frames and bar types.
        .
        I would be most grateful if you would please be so kind as to add this for me.

        Comment


          #5
          Hello jtrade,

          A bar will close depending on the BarType used to create the data series. These could be time based, or price based. I'll include information on NinjaTrader's different bar types and how they are built.

          NinjaTrader 8 BarTypes - https://ninjatrader.com/support/help.../bar_types.htm

          How Bars are built - https://ninjatrader.com/support/help..._are_built.htm

          The TASC article strategies and indicators are meant to serve as NinjaTrader editions of the strategy/indicator as they has been published in Stocks and Commodities magazine. These article entries are offered in source code for other platforms so strategy developers can use the study in their own applications. As a courtesy, we package these for you and may add some functionality before publishing to make it more robust than other platforms. However, we do not veer from the study behind the strategy or indicator. We are also a small team and are not equipped to implement client requests in these publications as it makes it difficult for us to provide quality support for our other clients.

          If you are looking for services to adapt the strategy for use with another bar type or would like to to add additional functionality, I can have a member of our Business Development team reach out with a list of NinjaScript Consultants that would be happy to develop this strategy further.

          Please let me know if I can be of further help.
          JimNinjaTrader Customer Service

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by CortexZenUSA, Today, 12:53 AM
          0 responses
          1 view
          0 likes
          Last Post CortexZenUSA  
          Started by CortexZenUSA, Today, 12:46 AM
          0 responses
          1 view
          0 likes
          Last Post CortexZenUSA  
          Started by usazencortex, Today, 12:43 AM
          0 responses
          5 views
          0 likes
          Last Post usazencortex  
          Started by sidlercom80, 10-28-2023, 08:49 AM
          168 responses
          2,265 views
          0 likes
          Last Post sidlercom80  
          Started by Barry Milan, Yesterday, 10:35 PM
          3 responses
          12 views
          0 likes
          Last Post NinjaTrader_Manfred  
          Working...
          X