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