Automatic Trading DONCHIAN Channel

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #72076 quote
    StevenSteven
    Participant
    New
    Hi im looking for some help to put a automated code together BUY ORDER If EMA 10/25 is BELOW Dounchain Channel Middle THEN place BUY order when candle stick hits Dounchain Channel DOWN. Close order when NEXT candle Stick hits EMA 10 SELL ORDER If EMA 10/25 is ABOVE Dounchain Channel Middle THEN place SELL order when candle stick hits Dounchain Channel UP. Close order when NEXT candle stick hits EMA 10   Moderator  edit: please don’t share personal information on forums. Thanks.
    #72080 quote
    NicolasNicolas
    Keymaster
    Legend
    Hi,

    >> Please update your country flag in your profile. Thank you 🙂 <<

    Topic moved in automatic trading forum.
    #72087 quote
    StevenSteven
    Participant
    New
    Hi done – can you help with the code?
    #72118 quote
    StevenSteven
    Participant
    New
    that should read donchain not dounchain
    #72159 quote
    NicolasNicolas
    Keymaster
    Legend
    Here is the code for your Donchian automatic trading strategy:
    DEFPARAM CumulateOrders = False 
    
    donchianperiod = 20 
    
    // indis 
    hh = highest[donchianperiod](high)
    ll = lowest[donchianperiod](low)
    mid = (hh+ll)/2
    ema10 = exponentialaverage[10]
    ema25 = exponentialaverage[25]
    
    // trading 
    if ema10>mid and ema25>mid then 
    buy 1 contract at hh stop 
    endif 
    
    if ema10<mid and ema25<mid then
    sellshort 1 contract at ll stop
    endif
    
    // exit trigger
    if longonmarket then 
    sell at ema10 stop 
    endif
    if shortonmarket then 
    exitshort at ema10 stop
    endif
    You did not tell what would be the Donchian channel period, so I made it as a variable you can change (default is 20 periods).
    #132785 quote
    Jaanboy321Jaanboy321
    Participant
    Average
    I’m looking for similar help. Is it possible to share code so I can OPEN a short position if price crosses Upper Donchian Channel THEN close order when it crosses Donchian Lower Channel (only one order open at any one time)? I can use this when there is a strong downward trend  -thanks.
Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.
ProRealAI ProRealAI New

Stuck on this ProBuilder code?

Describe what this topic is trying to build, in plain English, and ProRealAI writes the ProRealTime™ indicator, screener or system for you.

Available in 7 languages
Try ProRealAI

Automatic Trading DONCHIAN Channel


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
Steven @sbahia Participant
Summary

This topic contains 5 replies,
has 3 voices, and was last updated by Jaanboy321Jaanboy321
6 years, 4 months ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 06/02/2018
Status: Active
Attachments: No files
ProRealCode ProRealCode
Loading...