Enable trailing stop

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #65784 quote
    tosy
    Participant
    Junior

    Hi i´m trying to activate a strategy in automatic trading mode, i get the following error message(see attached file) make sure trailing stop is enabled on your account. how do i enable the trailing stop function? some one who knows? I don´t have this problem in backtesting mode

    Namnlöst1.png Namnlöst1.png
    #65796 quote
    Nicolas
    Keymaster
    Master

    It is not in the platform settings. There is a checkbox in your account preferences in your broker’s web interface (my account/settings/preferences), to allow or not the trailing stop functionality.

    #65798 quote
    tosy
    Participant
    Junior

    ok, thank you found it, but now i get this error message see attached, it seems that the system don´t like “h1=DPO[n](high)” do you know why or what´s wrong?

     

    r=1
    mb=average[20](typicalprice)
    k=48
    n=(k*2)-4
    p=(n/2)-1

    h1=DPO[n](high)

    moyh=high-h1
    hi=(moyh-moyh[1]+(high[p])/n)*n
    hi=(round(hi*100))/100
    l1=dpo[n](low)

    moyl=low-l1
    lo=(moyl-moyl[1]+(low[p])/n)*n
    lo=(round(lo*100))/100
    clo1=dpo[n](close)

    moyc=close-clo1
    clot=(moyc-moyc[1]+(close[p])/n)*n
    clot=(round(clot*100))/100
    cond1=(high>high[1] and high>high[2])
    cond2=(cond1 and high>hi[46]) and (barindex>bari or rr=-1)
    if cond1 and cond2 then
    flagg=1
    targeth=high
    targetl=lo[46]
    else
    flagg=0
    signa=mb
    endif
    for zz=0 to 45
    if clot[45-zz]<targetl and hi[45-zz]<=targeth and flagg=1 then
    signa=high+(averagetruerange[20](close))*.5
    rr=1
    bari=barindex+zz+2
    break
    elsif hi[45-zz]>targeth then
    signa=mb
    break
    endif
    next
    condi=(low<low[1] and low<low[2]) and low<lo[46] and (barindex>bar or rr=1)
    if condi then
    fflag=1
    target1=low
    target2=hi[46]
    else
    fflag=0
    siigna=mb
    endif
    for kk=0 to 45
    if clot[45-kk]>target2 and lo[45-kk]>=target1 and fflag=1 then
    siigna=low-(averagetruerange[20](close))*.5
    rr=-1
    bar=barindex+kk+2
    break
    elsif lo[45-kk]<target1 then
    siigna=mb
    break
    endif
    next
    if barindex < 100 then
    signa=undefined
    siigna=undefined
    endif
    golong = (siigna < mb)
    goshort = (signa > mb)*-1
    return golong as “LONG”,goshort as “SHORT”,0

    Namnlöst.jpeg Namnlöst.jpeg
    #65805 quote
    Nicolas
    Keymaster
    Master

    The DPO indicator is not allowed in automatic trading because this indicator use future datas which are, obviously, not available in real time, while it is the case in the past data history. There are plenty of topics that talked about this behavior in the forums.

    #65807 quote
    tosy
    Participant
    Junior

    Aha i had no idea, but that explains it

    i´m new here and found the indicator in the forum, i´have not seen any discussions about it

     

    thank you

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.

Enable trailing stop


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
tosy @tosy Participant
Summary

This topic contains 4 replies,
has 2 voices, and was last updated by tosy
7 years, 11 months ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 03/20/2018
Status: Active
Attachments: 2 files
Logo Logo
Loading...