• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

CloseOnProfitTarget

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

  • JamesDuke
    started a topic CloseOnProfitTarget

    CloseOnProfitTarget

    Wondering if it is possible to take the code from the CloseOnDrawdown Indicator found in the Ninja 7 downloads and reverse engineer it to close on ProfitTarget instead.

    So using the same logic to shut down a strategy once X profit objective is realized for the day.

    Thanks,
    Duke
    Attached Files

  • NinjaTrader_JuanitaA
    replied
    Hello,

    While we are unable to code for you, our NinjaTrader Ecosystem does support quite a few NinjaScript Consultants who would be happy to further assist you. You can view NinjaTrader Ecosystem's supported NinjaScript consultants at the following link:






    You can locate the contact information for the partner on their direct webpage for any additional questions you may have. Since these partners are third party add-ons for NinjaTrader all pricing information will need to be obtained through the partner.


    Please let me know if you have any additional questions.


    Have a great day!

    Leave a comment:


  • JamesDuke
    replied
    I do not know how to do that. I do not know how to code... that's why I am asking for help.

    Can you tweak the code for me?

    Leave a comment:


  • NinjaTrader_JessicaP
    replied
    Hello JamesDuke, and thank you for your question. Your approach is definitely feasible. I am going to include an emphasized code excerpt and a relevant helpguide page which I believe will aid you in putting together this strategy.

    Code:
    
                            if (!closing)
                            {
                                profitLoss = pos.GetProfitLoss(Close[0], 0);
                                btnActivate.Text = (drawdown + profitLoss).ToString();
                                textChanged = true;
    
    // JDP Mon Sep  5 11:18:59 MDT 2016
    // I believe if you change -drawDown to a static value
    // to compare profitLoss to, this strategy will work
    // the way you would like
                                if (profitLoss < -drawdown)
                                {
                                    closing = true;
                                    pos.Close();
                                    Log("Max drawdown of " + drawdown + " reached and canceled all orders from " + pos.Instrument, LogLevel.Alert);
                                }
                            }
    http://ninjatrader.com/support/helpG...=getprofitloss

    Please let us know if there are any other ways we can help.

    Leave a comment:

Latest Posts

Collapse

Topics Statistics Last Post
Started by pulpiwapi, 03-04-2019, 11:18 PM
11 responses
143 views
0 likes
Last Post music_p13  
Started by indy73, Yesterday, 10:52 PM
3 responses
17 views
0 likes
Last Post sledge
by sledge
 
Started by priceisking, Today, 12:51 PM
1 response
18 views
0 likes
Last Post NinjaTrader_PaulH  
Started by chartish, Today, 10:33 AM
3 responses
27 views
0 likes
Last Post chartish  
Started by casabella, Today, 11:51 AM
1 response
10 views
0 likes
Last Post NinjaTrader_PaulH  
Working...
X