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

Set Breakeven in ninjascript

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

    Set Breakeven in ninjascript

    Hi ,
    How can I set Breakeven in the Ninja script.
    I would appreciate if provide me a sample code.

    #2
    Hello bosajin,

    Below are links to examples of breakeven and custom exit order movement.

    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Hi ChelseaB

      How can I set breakeven by ATM template ?

      Comment


        #4
        Hello bosajin,

        When editing the template, set the Breakeven Profit Trigger to a value higher than 0.

        Below is a link to the help guide.
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          Hi Chelsea B.

          Could you please take a quick look to my code , I have changed SampleAtmStrategy , it seems to be not working.
          Attached Files

          Comment


            #6
            It doesn't show any Entry point and Stop loss and take profit point some thing like the attachment.

            Comment


              #7
              Hello bosajin,

              I cannot debug your code for you, but I can ask you questions and guide you if would like to debug the script yourself.

              You can also contact a professional NinjaScript Consultant who would be eager to create or modify this script at your request or assist you with your script. The NinjaTrader Ecosystem has affiliate contacts who provide educational as well as consulting services. Please let me know if you would like our business development follow up with you with a list of affiliate consultants who would be happy to create this script or any others at your request.


              Do you have an Atm template created named AtmStrategyTemplate?

              May we see a screenshot of the parameters for this?

              When calling AtmStrategyCreate() is there an error code returned?

              Are there errors on the log tab of the Control Center?

              What is the exact issue, the screenshots you have provided shows Profit target many times. This means the profit target is filling.
              Chelsea B.NinjaTrader Customer Service

              Comment


                #8
                Hi Chelsea B,

                I have attached ATMStrategyTemplateand also log tab(there is no error).

                I would use the following line of code
                AtmStrategyCreate(OrderAction.Buy, OrderType.Limit, GetCurrentBid(), 0, TimeInForce.Day, orderId, ATMName, atmStrategyId, callback);

                instead of EnterLongLimit(GetCurrentBid(), name);

                also TP/SL in ATM instead of

                SetStopLoss(CalculationMode.Currency, 60);
                SetProfitTarget(CalculationMode.Currency, 80);


                is it correct?

                The issue:
                I don't see an arrow which shows long and short place .something look likes the attached chart.

                Comment


                  #9
                  Hello bosajin,

                  Execution markers will only show on the chart for orders made through the NinjaScript Strategies internal methods.

                  Orders placed through Atm Strategy methods are the same as manual placed orders and do not affect the NinjaScript Strategy position or performance.

                  From the help guide:
                  "Executions resulting from an ATM Strategy that is created from within a NinjaScript automated strategy will not plot on a chart during real-time operation"
                  "Executions from ATM Strategies will not have an impact on the hosting NinjaScript strategy position and PnL - the NinjaScript strategy hands off the execution aspects to the ATM, thus no monitoring via the regular NinjaScript strategy methods will take place (also applies to strategy performance tracking)"



                  So open a new chart and do not apply a NinjaScript Strategy. if you want to see the executions markers on a chart,
                  Chelsea B.NinjaTrader Customer Service

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by LawrenHom, Today, 10:45 PM
                  0 responses
                  3 views
                  0 likes
                  Last Post LawrenHom  
                  Started by love2code2trade, Yesterday, 01:45 PM
                  4 responses
                  28 views
                  0 likes
                  Last Post love2code2trade  
                  Started by funk10101, Today, 09:43 PM
                  0 responses
                  7 views
                  0 likes
                  Last Post funk10101  
                  Started by pkefal, 04-11-2024, 07:39 AM
                  11 responses
                  37 views
                  0 likes
                  Last Post jeronymite  
                  Started by bill2023, Yesterday, 08:51 AM
                  8 responses
                  44 views
                  0 likes
                  Last Post bill2023  
                  Working...
                  X