Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Convert Lots from int to double

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

    Convert Lots from int to double

    I want to trade at 0.1 lots in my strategy but "Lots" is set to be an int. If I change it to a double then the strategy will not compile. It seems as thought Lots can only be an integer. How thereofre do I trade at less than 1 lot.

    Please help,

    Thanks

    Nigel.


    here is the relevant part of the code:-

    #region Variables
    // Wizard generated variables
    private double lots = 1.0; // Default setting for Lots


    if (ToTime(Time[0]) > 80005 && ToTime(Time[0]) <= 160000 && tradeno == 0)
    {
    EnterShort(Lots, "LondonShort");
    tradeno = tradeno + 1;
    }


    #region Properties
    [Description("Lots")]
    [Category("Parameters")]
    public double Lots
    {
    get { return lots; }
    set { lots = Math.Max(1.0, value); }
    //set { lots = Math.Round(1, value); }
    }


    Mnay thanks,

    Nigel

    #2
    Nigel, you can just enter the direct unit qty then, for example 10000 for a minilot in FX spot trading.

    Comment


      #3
      I'm sorry I don't understand that. What do I put in the code and where? Could you give me an example?

      Many thanks,

      Nigel.

      Originally posted by NinjaTrader_Bertrand View Post
      Nigel, you can just enter the direct unit qty then, for example 10000 for a minilot in FX spot trading.

      Comment


        #4
        Nigel, which brokerage technology are you using to execute this?

        To trade live for example a tenth of a regular lot (minilot) just enter 10000 as qty in your lot input if executing to for example IB (Ideal) or MBT.

        Comment


          #5
          I'm using MBT I tink I have misunderstood this, so 1 in Lot does not mean one full Lot, is that correct i.e. we are actually entering the currecny amount effectively to get a 1/0th of a full Lot. Is this correct/

          Thanks.

          Originally posted by NinjaTrader_Bertrand View Post
          Nigel, which brokerage technology are you using to execute this?

          To trade live for example a tenth of a regular lot (minilot) just enter 10000 as qty in your lot input if executing to for example IB (Ideal) or MBT.

          Comment


            #6
            Correct, for MBT live trading just enter the direct unit quantity you want to trade starting from 1000 which is a microlot so 1 / 100 the of the regulalr FX lot size.

            Comment


              #7
              Many thanks, explains my problem!

              Originally posted by NinjaTrader_Bertrand View Post
              Correct, for MBT live trading just enter the direct unit quantity you want to trade starting from 1000 which is a microlot so 1 / 100 the of the regulalr FX lot size.

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by Geovanny Suaza, 02-11-2026, 06:32 PM
              0 responses
              648 views
              0 likes
              Last Post Geovanny Suaza  
              Started by Geovanny Suaza, 02-11-2026, 05:51 PM
              0 responses
              369 views
              1 like
              Last Post Geovanny Suaza  
              Started by Mindset, 02-09-2026, 11:44 AM
              0 responses
              108 views
              0 likes
              Last Post Mindset
              by Mindset
               
              Started by Geovanny Suaza, 02-02-2026, 12:30 PM
              0 responses
              572 views
              1 like
              Last Post Geovanny Suaza  
              Started by RFrosty, 01-28-2026, 06:49 PM
              0 responses
              573 views
              1 like
              Last Post RFrosty
              by RFrosty
               
              Working...
              X