Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Startegy optimization with double type parameter

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

    Startegy optimization with double type parameter

    Hi,
    I'm actually test a simple strategy optimization when I go long when price crossover a moving average, as crossover does cannot be configured simply with offset (see topic below) I used the solution included in the following topic to achieve an offset entry ate the crossover

    Sorry if this has been addressed but I searched and could not find the answer. I'm sure I'm missing something simple. I'm trying to set an offset to a EMA crossover. So for example I would like to place a buy order when the 3EMA crosses above the 10EMA + 1.00. The wizzard does not seem to add the offset to the code, and NT8


    it works well with strategy builder whet I can see the entry is higher (offset) but if I add this offset as optimization parameter it seems not working (configured as 1-->1.05 wwith 0.01 incremenet which is a 100% to 105% with 1% increment) the two other parameters are correctly optimized but not the offset which is always use 1
    I optimize on max net profit

    Does anyone knows if we can optimize on double values ?

    (see attached picture)
    Thanks


    #2
    Hello bourasrafik,

    At this time double numbers are not optimizable, you would need to use an int for optimizations. If you needed a double number you would need to make a int for the purpose of optimization and then use math to get a double number.

    Comment


      #3
      Hi NinjaTrader_Jesse

      Could you share an example of you comment above to use int in optimization and get double by math?

      Regards.

      Comment


        #4
        Hello J2512,

        That depends on what range you need, you would have to use the appropriate math to calculate a double. For example if you needed values between 0.0 and 1.0 you could divide by 10:

        2 / 10 = 0.2

        The int property would be from 0 to 10.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by NullPointStrategies, Yesterday, 05:17 AM
        0 responses
        54 views
        0 likes
        Last Post NullPointStrategies  
        Started by argusthome, 03-08-2026, 10:06 AM
        0 responses
        130 views
        0 likes
        Last Post argusthome  
        Started by NabilKhattabi, 03-06-2026, 11:18 AM
        0 responses
        71 views
        0 likes
        Last Post NabilKhattabi  
        Started by Deep42, 03-06-2026, 12:28 AM
        0 responses
        44 views
        0 likes
        Last Post Deep42
        by Deep42
         
        Started by TheRealMorford, 03-05-2026, 06:15 PM
        0 responses
        49 views
        0 likes
        Last Post TheRealMorford  
        Working...
        X