Help for adding martingala

Forums ProRealTime English forum ProOrder support Help for adding martingala

Viewing 5 posts - 1 through 5 (of 5 total)
  • #14313

    Good evening to all,

     

    i would like to implement a martingala in my ts but i’m missing something.

    My sistem buy and sell according to a cross between 2 moving averages, but don’t reverse. The sistem has a strong stop and tprofit.

    I set the code below, but the martingala doesn’t work.

    Someone can help please?

    THX!

     

    #14321

    First of all, your CALL is wrong, please take a look at the documentation, to make it properly : http://www.prorealcode.com/documentation/call/

    Please provide the TDI indicator code you are calling in case the problem come from this one, once you have modified your line 2. Thank you.

    #14324

    Hi Nicolas,

    this is my tdi indicator.

    myrsi=RSI[13](close)
    a=Average[2](myrsi)
    b=Average[7](myrsi)
    c=Exponentialaverage[34](myrsi)
    return a as “green”, b as “red”, c as “yellow”

     

    But the problem is not the call function but the martingala set. Doesn’t work in backtest. After a losing position the proorder doesn’t open the right position size.

    #14348

    Here is your modified code.

    If you don’t want your strategy to take multiple orders at the same time, use the instruction I put at line 1.

    If you need hard takeprofit and stoploss, you should test if you are not on market before launch another contrarian order, otherwise it will close the current one at market.

    About your martingale position sizing, you need to compute it only when you try to put order on market, otherwise the code will increment the size of the position at each new candle (when the script is read).

    EDIT/ just saw that it is my 2000th post!

    #14352

    Thank you so much!

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

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