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 judysamnt7, 03-13-2023, 09:11 AM
            4 responses
            53 views
            0 likes
            Last Post DynamicTest  
            Started by ScottWalsh, Today, 06:52 PM
            4 responses
            33 views
            0 likes
            Last Post ScottWalsh  
            Started by olisav57, Today, 07:39 PM
            0 responses
            5 views
            0 likes
            Last Post olisav57  
            Started by trilliantrader, Today, 03:01 PM
            2 responses
            19 views
            0 likes
            Last Post helpwanted  
            Started by cre8able, Today, 07:24 PM
            0 responses
            6 views
            0 likes
            Last Post cre8able  
            Working...
            X