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

Entry after 2 signal loss in strategy

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

    Entry after 2 signal loss in strategy

    hi,
    if i've a strategy in execution...and i want to enter in a trade after 2 loss...

    how i do it?

    i have to record manually the enter and the exit or there is a method about it..

    thank

    #2
    Hello esignal,

    Can you further detail what you would like to accomplish?

    When you mention "enter in a trade after 2 loss" is this a loss of 2 ticks, or 2 points, or 2 concurrent trades that had negative PnL?

    When you mention "i've a strategy in execution" does this mean that the strategy has a position after an execution has taken place?
    (Meaning the trade has not been exited?)

    When you mention "i've a strategy in execution...and i want to enter in a trade" does this mean you want to further scale into an existing position? If you were long 1 you want to become long 2?

    When you mention "i have to record manually the enter and the exit or there is a method about it" are you asking if it is possible to automatically exit a trade after a certain amount of loss like a Stop Loss or a Profit Target?
    Yes, this would be possible by using SetStopLoss and SetProfitTarget().
    For example:
    SetStopLoss(CalculationMode.Ticks, 2);
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Sorry for my bad english...

      see pics :

      it's historical trade....
      i want to enter after 2 trade loss...

      I put an arrow where i want to entry signal.
      Attached Files

      Comment


        #4
        Thank you for clarifying esignal. The following condition will be true when you have lost two consecutive trades. Please let us know if there are any other ways we can help.

        Code:
        if ( SystemPerformance.AllTrades.Count[COLOR=#ffffff] [/COLOR]> 1 && SystemPerformance.AllTrades[COLOR=#ffffff][/COLOR][COLOR=#ff6600][/COLOR][SystemPerformance.AllTrades.Count-2].ProfitPoints > 0.0 && SystemPerformance.AllTrades[COLOR=#ffffff][/COLOR][COLOR=#ff6600][/COLOR][SystemPerformance.AllTrades.Count-1].ProfitPoints > 0.0 )
        Jessica P.NinjaTrader Customer Service

        Comment


          #5
          two trade loss.....Do you wanted to write :

          ProfitPoints <0 ? (two trade in loss consecutive)
          ?
          Last edited by esignal; 03-13-2017, 08:09 AM.

          Comment


            #6
            To clarify this code, this is a test to see if your 2nd most recent trade, that is

            Code:
            SystemPerformance.AllTrades[SystemPerformance.AllTrades.Count-2]
            And your most recent trade, that is

            Code:
            SystemPerformance.AllTrades[SystemPerformance.AllTrades.Count-1]
            Both have positive profit values, that is

            Code:
            ... ..ProfitPoints > 0.0
            TradeCollections, like SystemPerformance.AllTrades, are documented here for more information.

            Last edited by NinjaTrader_JessicaP; 03-13-2017, 08:42 AM.
            Jessica P.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by bmartz, 03-12-2024, 06:12 AM
            4 responses
            31 views
            0 likes
            Last Post bmartz
            by bmartz
             
            Started by Aviram Y, Today, 05:29 AM
            4 responses
            12 views
            0 likes
            Last Post Aviram Y  
            Started by algospoke, 04-17-2024, 06:40 PM
            3 responses
            28 views
            0 likes
            Last Post NinjaTrader_Jesse  
            Started by gentlebenthebear, Today, 01:30 AM
            1 response
            8 views
            0 likes
            Last Post NinjaTrader_Jesse  
            Started by cls71, Today, 04:45 AM
            1 response
            7 views
            0 likes
            Last Post NinjaTrader_ChelseaB  
            Working...
            X