Indicator to Optimizer

Forums ProRealTime English forum ProOrder support Indicator to Optimizer

Viewing 13 posts - 1 through 13 (of 13 total)
  • #237912

    Hi.

    This looks intressting

    https://www.prorealcode.com/prorealtime-indicators/candlestick-pattern-indicator-2-0/

     

    How do I use the optimizer to backtest and find the best entry with this indicator.

    #237937

    Hi!
    You could create a new variable called “type” (for example) and introduce in conditions to take a long position:
    Here you have an example with 4 variations. Your code has a lot of types…

    2 users thanked author for this post.
    #237941

    Thank you Ivan. That helped alot!

    #237944

    I added the variable Signal to tell which pattern is returned and the variable Opt to be used with the optimizer.

    The optimizer will pliot the best performing patterns for LONG trades.

    Then you will have to uncomment line 487 and comment out line 486 to repeat the optimization for the best performing patterns for SHORT trades.

    Here is the code:

     

    #237946

    I din’t read Ivan’s reply 🙂

     

    1 user thanked author for this post.
    #237949

    @ROBERTO

    there should be missing some lines related to OPT.

    please kindly check it.

    many thanks

     

    #237951

    The ITF file is working like a charm.

     

    #237952

    @roberto

    sorry, i just copied it without downloading the itf

    1 user thanked author for this post.
    #237964

    Several of the ‘Signals’ show body < 0 (example below).

    How can a body be less than 0?

    Or is it that PRT uses one calc only for body – Close – Open (instead of abs(Close-Open) – and so with a red candle, Close – Open gives a negative number and so this is interpreted by PRT as < 0?

    Or do I need more coffee!? 😉

    BearSash=(body[1]>0 AND longcandle[1] AND body<0 AND longcandle AND open>open[1] AND open<close[1] AND close<open[1] AND shadowbottom<0.1*abody)
    if BearSash then Signal = 50

    EDIT / PS
    Signal 50 does get selected by the optimser so PRT does interpret body < 0 somehow?

    #237967

    Only had a quick glance at code…

    On line 13, if body is bear, close-open will result in a negative value, as you noted, Therefore, is  body<0,  just a way of knowing its a bear candle by the fact, bear will be negative and bull will be positive.

    The BearSash statement is  a logic equation, if  body<0 was negative, this part results to true ‘1’. If it was positive it results in false ‘0’.

    All part of the statement need to be true for Bearish to be true, if body was bull, the statement would fail false.

    In this case the value of body appears not needed here just if its + or -.

    Maybe the variable names may be a bit misleading, body = candleDirection,  abody = candleSize,

    additionally line 15,  abody = abs(body) is just the size of the body if that info is required in a condition.

    1 user thanked author for this post.
    #237968

    I think there is a little bug: the AbandonedBabyBottom signal should be 3 , not 2. From there you have to add 1 to all the signal values. Otherwise, superjob from @lighthouse and @roberto !

     

    1 user thanked author for this post.
    #237969

    Well spotted!
    Easier to renumber the first 4 as 0,1,2,3 and enter 0 – 56 -1 in the optimiser?

     

    #237970

     

    Well spotted! Easier to renumber the first 4 as 0,1,2,3 and enter 0 – 56 -1 in the optimiser?

    even easier, just renumber AbandonedBabyBottom signal from 2 to 57

    1 user thanked author for this post.
Viewing 13 posts - 1 through 13 (of 13 total)

Create your free account now and post your request to benefit from the help of the community
Register or Login