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

Sub-pips Stops?

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

    Sub-pips Stops?

    Greetings,

    I've recently enabled the "sub-pips" setting in the Control Panel. Because of this, I'm now having some difficulties setting my StopLoss levels (where I hadn't before). Here is the code I'm using but it doesn't seem to properly set the StopLoss and I don't know why:

    EnterPlace = Close[0] + ((0 / TickSize) / 10);
    ExitPlace = EnterPlace - ((30 / TickSize) / 10);
    SetStopLoss(
    "HI Entry", CalculationMode.Price, ExitPlace, false);

    I know that this accurately calculates the correct number of pips (30), but the StopLoss level is not correctly set anymore (before I enabled the "sub-pips")...can somebody point out my error?

    #2
    I suggest debugging your code by printing out the stop prices and the actual TickSize to see what's going on.

    Comment


      #3
      Thanks, I'm getting some ridiculous value for "ExitPlace"...like around -300000, with a TickSize value of 1E-05...I have no idea why it is calculating about 10000 bigger than it should...What explains that TickSize value of 1E-05?

      Comment


        #4
        1E-05 is the expected TickSize for e.g. EURUSD when subpip support is enabled. You need to reconsider your math for the stop prices.

        Comment


          #5
          Thank you for the reply. What then would be a proper technique when using "sub pips" to set StopLoss accurately?

          Comment


            #6
            Unfortunately we are unable to provide support of doing actual math. As last resort a certified NinjaScript consultant would be at hour help: http://www.ninjatrader.com/webnew/pa...injaScript.htm

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by andrewtrades, Today, 04:57 PM
            1 response
            5 views
            0 likes
            Last Post NinjaTrader_Manfred  
            Started by chbruno, Today, 04:10 PM
            0 responses
            3 views
            0 likes
            Last Post chbruno
            by chbruno
             
            Started by josh18955, 03-25-2023, 11:16 AM
            6 responses
            436 views
            0 likes
            Last Post Delerium  
            Started by FAQtrader, Today, 03:35 PM
            0 responses
            7 views
            0 likes
            Last Post FAQtrader  
            Started by rocketman7, Today, 09:41 AM
            5 responses
            19 views
            0 likes
            Last Post NinjaTrader_Jesse  
            Working...
            X