tradeprice / entryprice

Forums ProRealTime English forum ProOrder support tradeprice / entryprice

Viewing 4 posts - 1 through 4 (of 4 total)
  • #216938

    Hi guys

     

    I have written a probacktest code which enters short and long trades based on an indicator signal. what I am wanting to do is optomise it so that it enters an optimised number of pips above or below the entry signal.

    Please see attached ITF file which I hope will give you some idea of what I mean.

    // Definition of code parameters
    DEFPARAM CumulateOrders = False // Cumulating positions deactivated
    // Conditions to enter long positions
    ignored, indicator2 = CALL “123v2″[70, 30, 14]
    c1 = (indicator2 < 0)

    IF c1 and (tradeprice – (a)) THEN
    BUY 1 PERPOINT AT MARKET
    ENDIF

    // Conditions to enter short positions
    indicator5, ignored = CALL “123v2″[70, 30, 14]
    c3 = (indicator5 > 0)

    IF c3 and (tradeprice + (b)) THEN
    SELLSHORT 1 PERPOINT AT MARKET
    ENDIF

    // Stops and targets

    SET TARGET pPROFIT (c)

     

    Many thanks in anticipation.

     

     

    #216951

    Line 7, (tradeprice – (a)), is always negative because it is missing something you need to compare (tradeprice – (a)) to something… what, maybe CLOSE?

    Forthermore, condition C1 is always 0 (not met). You should check the value returned by indicator2, appending this instruction to your code:

     

    #217195

    Hi Roberto, many thanks for your reply

    you are correct the indicator (see attached) is by default at “0” unless a divergence is identified.

    I then have a proscreener (again attached) for which I’d appreciate a little guidance. I can search for the MA direction and the 4hr Bollinger periodically  but when it comes to an indicator signal for the previous 8 x 1hr or 16 x 30 minutes but is there a way to search for the previous 16 candles without going [1], [2], [3] thru to [16] or can you go [1 – 16]

    And finally, with the probacktest and entry is made at the close of the candle delivering the >0 (buy) or <0 (sell) signal, what I’m trying to ascertain is the optimum historical price above that close (based on previous entry points) to finally enter the trade, i suppose in a roundabout way the average drawdown based on previous trades.

    Many thanks in anticipation

    Chris

     

     

     

    #218949

    You should add PipSize as a multiplier for a, b and c, such as:

    moreover, TRADEPRICE is always 0, what is exactly the price you want to use in the expression, why did you use TRADEPRICE?

     

     

Viewing 4 posts - 1 through 4 (of 4 total)

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