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

Strategy profit questions

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

    Strategy profit questions

    Pardon me piggy-backing on this but I have a related set of questions.

    Assume I have the same strategy running on 2-4 different instruments, but all placing orders in the same account.

    I have 2 scenarios:

    1) I want to Stop Trading When My Daily NetProfit in the Account Reaches a Certain Target


    Is my understanding correct, that for overall profit/loss I need to use the AccountItem.GrossRealizedProfitLoss ,to Compare to my Daily Max Profit / Loss targets. Right?

    2) I want to Stop Trading When My Daily NetProfit on the specific strategy/instrument Reaches a Certain Level


    I'd use
    SystemPerformance.AllTrades.TradesPerformance.Curr ency.CumProfit to get the current CumProfit just on that Strategy/Chart combination. (as shown in the educational sample "SamplePnL")

    In other words, If I run this strategy on 4 charts, each is treating the strategy independently of any other instances of this strategy running. I.e. it ignores the same strategy's CumProfit on a different chart (data series).

    And lastly, If I disable the strategy on the chart and re-enable it, does this value for CumProfit reset to zero? (for the 2nd scenario)
    Last edited by EminiTrader; 06-17-2020, 03:49 PM. Reason: edited for ease of reading

    #2
    Hello EminiTrader,

    Thank you for the post.

    I went ahead and started a thread for your questions so we can avoid having two different conversations going in the same thread. That way we can branch off if needed.



    1) I want to Stop Trading When My Daily NetProfit in the Account Reaches a Certain Target
    Is my understanding correct, that for overall profit/loss I need to use the AccountItem.GrossRealizedProfitLoss ,to Compare to my Daily Max Profit / Loss targets. Right?
    What you have shown is correct, you would have to access the account directly and get the value. The strategies TradePerformance values are going to relate to its specific trade performance.



    2) I want to Stop Trading When My Daily NetProfit on the specific strategy/instrument Reaches a Certain Level
    I'd use
    SystemPerformance.AllTrades.TradesPerformance.Curr ency.CumProfit to get the current CumProfit just on that Strategy/Chart combination. (as shown in the educational sample "SamplePnL")

    In other words, If I run this strategy on 4 charts, each is treating the strategy independently of any other instances of this strategy running. I.e. it ignores the same strategy's CumProfit on a different chart (data series).
    Your understanding is correct.

    And lastly, If I disable the strategy on the chart and re-enable it, does this value for CumProfit reset to zero? (for the 2nd scenario)
    It does, but because the strategy recalculates historical when re enabled any orders are placed during that time will be accounted for. Assuming the strategy does not trade historically and just enters realtime flat, yes it would be reset to 0 after disabling and re enabling it.

    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment


      #3
      Thanks Jesse! Since my topic is limiting trades based on NetProfit, I have a related question as a followup.

      I want to have a strategy use an ATM Template, I know how to do this part for simple trades. I also have the example ATMPnl., so I can follow the example in that strategy example to limit trades based on PNL.. But within that strategy I need to place a bracket order using "OCO" with buyStopMarket above a certain level, and an "OCO" SellStopMarket bellow-but am not sure of how to do this within a strategy (vs on ChartTrader)
      Last edited by EminiTrader; 06-18-2020, 02:29 PM. Reason: Added more detail on my question

      Comment


        #4
        Hi EminiTrader, thanks for your reply.

        In the managed approach you can not have entry orders on either side of the market at the same time, the order will be ignored. You would need to use the unmanaged approach to submit a bracket in that way. So you would set up limit or stop orders on either side of the market using ATMStrategyCreate. When using ATM strategies, you will not get updates from OnOrderUpdate or OnExecutionUpdate so you would need to check the status of each order using GetAtmStrategyEntryOrderStatus.

        Please let me know if I can assist any further.
        Chris L.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by llanqui, Yesterday, 09:59 AM
        8 responses
        28 views
        0 likes
        Last Post llanqui
        by llanqui
         
        Started by quicksandatl, Today, 01:39 PM
        1 response
        2 views
        0 likes
        Last Post quicksandatl  
        Started by md4866, 05-01-2024, 08:15 PM
        2 responses
        18 views
        0 likes
        Last Post md4866
        by md4866
         
        Started by samish18, Today, 12:20 PM
        0 responses
        7 views
        0 likes
        Last Post samish18  
        Started by thread, 04-15-2024, 11:58 PM
        3 responses
        48 views
        0 likes
        Last Post Georg1o
        by Georg1o
         
        Working...
        X