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 CarlTrading, 03-31-2026, 09:41 PM
              1 response
              65 views
              0 likes
              Last Post NinjaTrader_ChelseaB  
              Started by CarlTrading, 04-01-2026, 02:41 AM
              0 responses
              35 views
              0 likes
              Last Post CarlTrading  
              Started by CaptainJack, 03-31-2026, 11:44 PM
              0 responses
              59 views
              1 like
              Last Post CaptainJack  
              Started by CarlTrading, 03-30-2026, 11:51 AM
              0 responses
              62 views
              0 likes
              Last Post CarlTrading  
              Started by CarlTrading, 03-30-2026, 11:48 AM
              0 responses
              51 views
              0 likes
              Last Post CarlTrading  
              Working...
              X