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 Mindset, 04-21-2026, 06:46 AM
        0 responses
        88 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by M4ndoo, 04-20-2026, 05:21 PM
        0 responses
        135 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Started by M4ndoo, 04-19-2026, 05:54 PM
        0 responses
        68 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Started by cmoran13, 04-16-2026, 01:02 PM
        0 responses
        119 views
        0 likes
        Last Post cmoran13  
        Started by PaulMohn, 04-10-2026, 11:11 AM
        0 responses
        69 views
        0 likes
        Last Post PaulMohn  
        Working...
        X