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

Need clarification on CalculationMode.Ticks

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

    Need clarification on CalculationMode.Ticks

    Hi,

    I seem to be misunderstanding CalculationMode.Ticks. I previously was using the ATM where I believe when I specified 10 ticks, I would see the orders places about where I expected to see them, for example 10 ticks. I this snippet of code I am expecting to see the limit order 10 ticks above/below the entry price.

    In the attached screen image for Silver the order seems well beyond 10 ticks in Silver which is $25, or .005 per tick (ticksize).

    PTarget1 = 10;

    }
    else if (State == State.Configure)
    {
    ProcessHours_OnStartUp();
    SetProfitTarget("Long 1a", CalculationMode.Ticks, PTarget1);


    I seems to be obviously missing something can anyone let me know what I'm missing.

    Thank you

    glen
    Attached Files
    Last edited by demarcog; 05-30-2021, 08:01 PM.

    #2
    hey Demarcog,

    how about that ?
    SetProfitTarget("Long 1a", CalculationMode.Ticks, Convert.ToInt32(PTarget1 ));

    Comment


      #3
      hey Demarcog,

      I just realized convert to int will not be it, because your target name is not a int... lol,

      Comment


        #4
        Hello glen,

        I was not able to reproduce this behavior.

        Attached is a simple test script. The profit target is being placed 10 ticks (2.5 points) from the entry.

        (edit - The TenTickProfitTargetTest_NT8.zip file is attached to this post, but the forum isn't showing it for some reason. Hosted on google drive link below)
        Attached Files
        Last edited by NinjaTrader_ChelseaB; 05-31-2021, 10:01 AM.
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          Hi Chelsea,

          Thank you for the response I appreciate your help and quick response.

          My assumption is the code I attached is syntactically correct?

          Did you intend an you attach the script as I don't see the code?

          If the code is syntactically correct and not working, any suggestions on how I should proceed?

          Thank you again.

          Glen
          Last edited by demarcog; 05-31-2021, 08:54 AM.

          Comment


            #6
            Hello demarcog,

            Very odd. The forum was showing the file attached when in edit mode, but not in the post. I had to remove it and re-add it to get it to show..

            I'm unsure of how to proceed since the code you have suggested is doing exactly what it should and I don't see any issue.
            Chelsea B.NinjaTrader Customer Service

            Comment


              #7
              Hi Chelsea,

              Sorry but I don't see it, can you copy the code you used inline?

              Thank you,

              glen

              Comment


                #8
                Hello glen,

                Hold Shift and click F5, does the file show?
                Chelsea B.NinjaTrader Customer Service

                Comment


                  #9
                  Chelsea,

                  No sorry not seeing anything, screen just flashes something quickly.

                  Glen

                  Comment


                    #10
                    Hi Glen,

                    Thanks for trying that.

                    I'll alert our IT. I've put a link to the file hosted on drive in the post.
                    Chelsea B.NinjaTrader Customer Service

                    Comment


                      #11
                      Hi Chelsea,

                      Thank you very much for taking the time to help me out.

                      I loaded and enabled and thought I should see the order show up on the chart with Chart Trader Open and/or in the orders tab, but not seeing it.

                      It's not a high priority item I appreciate the help and don't want to take up a lot of your time with this.

                      Thank you

                      Glen
                      Attached Files

                      Comment


                        #12
                        Hello Glen,

                        With Chart Trader open and set to the same account as the strategy, the order will be placed on the first bar close in real-time.

                        Trying using Calculate.OnPriceChange or try a 1 second chart.
                        Chelsea B.NinjaTrader Customer Service

                        Comment


                          #13
                          Chelsea,

                          I tried, will try again when the markets open, thanks

                          gken

                          Comment


                            #14
                            Hello glen,

                            Try using the Simulated Data Feed with Default 24 / 7 trading hours template.
                            Chelsea B.NinjaTrader Customer Service

                            Comment


                              #15
                              Chelsea,


                              Thanks for the help that worked.

                              No idea why it doesn't work on my system.

                              glen

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by ninza33, Today, 12:31 PM
                              2 responses
                              9 views
                              0 likes
                              Last Post ninza33
                              by ninza33
                               
                              Started by Bobin, 03-12-2024, 08:51 AM
                              15 responses
                              480 views
                              0 likes
                              Last Post fiddich
                              by fiddich
                               
                              Started by Skifree, Today, 11:21 AM
                              4 responses
                              13 views
                              0 likes
                              Last Post Skifree
                              by Skifree
                               
                              Started by Bogdan097, Today, 03:25 PM
                              0 responses
                              3 views
                              0 likes
                              Last Post Bogdan097  
                              Started by cmtjoancolmenero, 04-25-2024, 03:58 PM
                              25 responses
                              127 views
                              0 likes
                              Last Post cmtjoancolmenero  
                              Working...
                              X