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 CarlTrading, 05-11-2026, 05:56 AM
        0 responses
        53 views
        0 likes
        Last Post CarlTrading  
        Started by CarlTrading, 05-10-2026, 08:12 PM
        0 responses
        32 views
        0 likes
        Last Post CarlTrading  
        Started by Hwop38, 05-04-2026, 07:02 PM
        0 responses
        195 views
        0 likes
        Last Post Hwop38
        by Hwop38
         
        Started by CaptainJack, 04-24-2026, 11:07 PM
        0 responses
        356 views
        0 likes
        Last Post CaptainJack  
        Started by Mindset, 04-21-2026, 06:46 AM
        0 responses
        277 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Working...
        X