Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Rolling Profits

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

    Rolling Profits

    Hi,

    I have two newb questions I can't seem to figure out.

    1. While backtesting my strategy, I want to be able to roll the profits from the previous trade and increase my buying power for the next trade. How would I go about this? I currently have "Order Quantity" set to "account size", but it is giving me a fixed amount for each trade.

    2. How do I plot two indicators on the same panel from within the strategy?

    #2
    reticent,

    I am happy to assist.

    1. You would need to adjust the quantity from within your strategy. This can be done by setting "Set order quantity" to "by strategy", then using the proper override for the entrance method.

    Such as : EnterLong(int quantity, string signalName)

    2. You can use the Add() method more than once.

    Add(SMA(Fast));
    Adam P.NinjaTrader Customer Service

    Comment


      #3
      Thanks for the quick response. I don't think I was clear in my second question...

      I know how to add multiple indicators with the Add() command and I can change their appearance through the Plot() method. But what I am trying to do is add multiple indicators to the same plot panel. For instance, say I want two instances of a Stochastics indicator (with different parameters for each) plotted in the same panel. What command would I use for that?

      And just to clarify on the first question... As far as I understand, the EnterLong() would provide only a set quantity of shares, correct? That doesn't help me. What I am trying to do is ensure that my profit or loss from my previous trade is rolled into the overall account value and the full buying power of the new, adjusted amount is utilized for the next trade.

      For example if my initial account balance is 100k and my last trade netted 10k, my new balance would be 110k. Therefore, in my backtesting, I would want the buying power of my next trade to be the full 110k. So on and so forth. How would I do that?

      Comment


        #4
        Originally posted by reticent67 View Post
        Thanks for the quick response. I don't think I was clear in my second question...

        And just to clarify on the first question... As far as I understand, the EnterLong() would provide only a set quantity of shares, correct? That doesn't help me. What I am trying to do is ensure that my profit or loss from my previous trade is rolled into the overall account value and the full buying power of the new, adjusted amount is utilized for the next trade.
        Basically you would be changing the quantity based on your formula.

        int quantity = my_calculation;

        EnterLong(quantity, "order name");

        Since the quantity is changing, the EnterLong() would enter additional (or not) contracts based on your formula.

        I know how to add multiple indicators with the Add() command and I can change their appearance through the Plot() method. But what I am trying to do is add multiple indicators to the same plot panel. For instance, say I want two instances of a Stochastics indicator (with different parameters for each) plotted in the same panel. What command would I use for that?
        This would be unsupported code but I believe this may be what you are looking for :

        EMA(10).Panel = 1;

        I haven't tested it but I am aware others have done something like that before.
        Adam P.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by PhillT, Today, 02:16 PM
        2 responses
        3 views
        0 likes
        Last Post PhillT
        by PhillT
         
        Started by Kaledus, Today, 01:29 PM
        3 responses
        9 views
        0 likes
        Last Post NinjaTrader_Jesse  
        Started by frankthearm, Yesterday, 09:08 AM
        14 responses
        47 views
        0 likes
        Last Post NinjaTrader_Clayton  
        Started by gentlebenthebear, Today, 01:30 AM
        2 responses
        14 views
        0 likes
        Last Post gentlebenthebear  
        Started by PaulMohn, Today, 12:36 PM
        2 responses
        17 views
        0 likes
        Last Post PaulMohn  
        Working...
        X