• 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

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.
    https://ninjatrader.com/support/foru...596#post806596
    https://ninjatrader.com/support/foru...269#post802269
    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.
        https://ninjatrader.com/support/help...evenParameters
        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)"
                  https://ninjatrader.com/support/help...strategies.htm


                  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 granitmaleaus, Today, 05:11 AM
                  0 responses
                  1 view
                  0 likes
                  Last Post granitmaleaus  
                  Started by julianc05, Today, 12:37 AM
                  1 response
                  9 views
                  0 likes
                  Last Post Emma1
                  by Emma1
                   
                  Started by fernlicht, Today, 01:02 AM
                  1 response
                  11 views
                  0 likes
                  Last Post Emma1
                  by Emma1
                   
                  Started by JellyRoll, Yesterday, 06:57 PM
                  1 response
                  23 views
                  0 likes
                  Last Post bltdavid  
                  Started by Dan_D_Trader, Yesterday, 06:22 PM
                  1 response
                  7 views
                  0 likes
                  Last Post Emma1
                  by Emma1
                   
                  Working...
                  X