Translate backtest code snippet to Mt4

Forums ProRealTime English forum General trading discussions Translate backtest code snippet to Mt4

Viewing 3 posts - 1 through 3 (of 3 total)
  • #104542

    Hi!

    Just starting out with some coding in prt.

    I also use MT4 and would greatly appreciate if someone could

    help me how this would translate in mt4 (mql).

    I use it when i backtest trend indicators performance.

     

    DEFPARAM CumulateOrders = False
    Indicator1 = CCI[20](typicalPrice)
    ATR = AverageTrueRange[20](close)
    BuyOrder = (Indicator1 CROSSES OVER 0)
    IF BuyOrder THEN
    BUY 1 CONTRACT AT MARKET
    SL = ATR *1
    TP = ATR *2
    ENDIF
    SellOrder = (Indicator1 CROSSES UNDER 0)
    IF SellOrder THEN
    SellShort 1 CONTRACT AT MARKET
    SL = ATR *1
    TP = ATR *2
    ENDIF
    SET STOP LOSS SL
    SET TARGET PROFIT TP

    #104543

    Sorry, but this forum only supports the ProRealTime trading platform.

    It is possible to convert code from other platforms to ProRealTime, not the other way round.

    I think you can find MT4 forums over the internet to achieve your goal.

     

    #104544

    ….or use the paid for ProRealCode programming service by filling in the form that can be found here:

    https://www.prorealcode.com/trading-programming-services/

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

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