NexusFi: Find Your Edge


Home Menu

 





Donchian Channel for EasyLanguage


Discussion in EasyLanguage Programming

Updated
      Top Posters
    1. looks_one Shaban with 4 posts (0 thanks)
    2. looks_two canucck with 3 posts (1 thanks)
    3. looks_3 themeantrader with 3 posts (0 thanks)
    4. looks_4 Big Mike with 2 posts (17 thanks)
      Best Posters
    1. looks_one Big Mike with 8.5 thanks per post
    2. looks_two olobay with 1.5 thanks per post
    3. looks_3 Fonz with 1.5 thanks per post
    4. looks_4 canucck with 0.3 thanks per post
    1. trending_up 39,358 views
    2. thumb_up 24 thanks given
    3. group 18 followers
    1. forum 26 posts
    2. attach_file 6 attachments




 
Search this Thread
  #21 (permalink)
themeantrader
Towcester, United Kingdom
 
Posts: 3 since Feb 2021
Thanks Given: 0
Thanks Received: 0

Hi, I'm new to Easylanguage and struggling with programming the Donchian (or Price Channel) as I need it.

I'm looking to either add the displace functionality to the Donchian code I already have (further down in this page), or adding the MEAN to the existing code for the Price Channel. I need the MEAN and the displace option and neither the Donchian or Price Channel have both.

I'm guessing it's easier to add the MEAN to the Price Channel code (below). I've added a var2 and plot3 but can't get anything to compile. Any help very gratefully appreciated.

Thanks
TMT


inputs: Length( 20 ), Displace( 0 ) ;
variables: var0( 0 ), var1( 0 ) ;

var0 = Lowest( Low, Length )[1] ;
var1 = Highest( High, Length )[1] ;

condition1 = Displace >= 0 or CurrentBar > AbsValue( Displace ) ;
if condition1 then
begin
Plot1[Displace]( var1, "UpperBand" ) ;
Plot2[Displace]( var0, "LowerBand" ) ;
Plot3 ((var1 +var0)/2, "MEAN" );

if Displace <= 0 then
begin
condition1 = Low crosses under var0 ;
if condition1 then
Alert( "Price making new low" ) ;
condition1 = High crosses over var1 ;
if condition1 then
Alert( "Price making new high" ) ;
end ;
end ;


Reply With Quote

Can you help answer these questions
from other members on NexusFi?
CFTC Opens First COT Report Review in 20 Years -- Asks W …
Traders Hideout
Weekend Update: First Qatari LNG Transit Attempted -- IR …
Traders Hideout
Warsh Drops Easing Bias, December Hike Now Above 50% -- …
Prediction Markets & Event Contracts
Memorandum Watch: How the 60-Day MOU Framework Makes May …
Prediction Markets & Event Contracts
Iran Forward Curve: June 30 at 56% vs June 15 at 28% -- …
Prediction Markets & Event Contracts
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
NexusFi site changelog and issues/problem reporting
10 thanks
Darmok and Jalad at Tanagra
3 thanks
Big Mike in Ecuador
1 thanks
30 Sessions
1 thanks
  #22 (permalink)
Shaban
Turin + Italy
 
Posts: 201 since Feb 2020
Thanks Given: 26
Thanks Received: 138

Hi,

I tried to insert the Function that I found in this thread, but Tradestation reports this error:
"A value was never assigned to user function"

if someone can solve the problem, I thank you in advance.

................................................................

Function:

// Ported to MultiCharts by Big Mike, https://nexusfi.com/

// Dec 23 2010



inputs:

period (NumericSimple),

myMid (NumericRef),

myUpper (NumericRef),

myLower (NumericRef);



myUpper = Highest(H, period);

myLower = Lowest(L, period);

myMid = (myUpper + myLower) / 2;

--------------------------------------------------------------------

[img]https://i.postimg.cc/NjmDMrvF/Donchian-Channel-errore-Funzione.jpg[/img]


Reply With Quote
  #23 (permalink)
 
Fonz's Avatar
 Fonz 
Miami, Fl
 
Experience: Advanced
Platform: TradingView
Broker: IBKR + Tradovate
Trading: Futures
Frequency: Several times daily
Posts: 56 since Feb 2012
Thanks Given: 27
Thanks Received: 66


Here is what I have.
Hope this helps.


Attached Files
Elite Membership required to download: DONCHIAN CHANNEL.ELD
Reply With Quote
Thanked by:
  #24 (permalink)
Shaban
Turin + Italy
 
Posts: 201 since Feb 2020
Thanks Given: 26
Thanks Received: 138


Fonz View Post
Here is what I have.
Hope this helps.

Thank you, but unfortunately Tradestation 8.2 cannot read the .ELD files of the higher versions (9 and 10, see image).
If you can insert the Function of the Donchian Channel in text format (txt).
Thank you very much.

[img]https://i.postimg.cc/6q6rVGgq/Donchian-Channel-per-Tradestation-10.jpg[/img]


Reply With Quote
  #25 (permalink)
 
Fu510n's Avatar
 Fu510n 
Suffield, CT
 
Experience: Advanced
Platform: TS, MC, MW, Python, Rust
Broker: TS, IB, IQFeed, Kraken
Trading: NQ, ES, CL, RTY
Frequency: Several times daily
Duration: Seconds
Posts: 165 since Oct 2009
Thanks Given: 943
Thanks Received: 166


Shaban View Post
Hi,

I tried to insert the Function that I found in this thread, but Tradestation reports this error:
"A value was never assigned to user function"

if someone can solve the problem, I thank you in advance.

................................................................

Function:

// Ported to MultiCharts by Big Mike, https://nexusfi.com/

// Dec 23 2010



inputs:

period (NumericSimple),

myMid (NumericRef),

myUpper (NumericRef),

myLower (NumericRef);



myUpper = Highest(H, period);

myLower = Lowest(L, period);

myMid = (myUpper + myLower) / 2;

--------------------------------------------------------------------

[img]https://i.postimg.cc/NjmDMrvF/Donchian-Channel-errore-Funzione.jpg[/img]

Functions typically need to always return "something", so for the Donchian code above, simply add...
 
Code
DonchianChannel = myMid;
...to the end of the code (assuming the name of the function is "DonchianChannel"; if not, simply replace the variable name with the name of the function itself).

The 3 (NumericRef) output variables are generally what you're using anyway so this is just to satisfy the compiler.


Follow me on X Reply With Quote
  #26 (permalink)
Shaban
Turin + Italy
 
Posts: 201 since Feb 2020
Thanks Given: 26
Thanks Received: 138

For Fu510n: thank you very much.

Here there is a Trading System in Easylanguage with the Donchian Channel:

TRADERS’ TIPS - February 2014


Reply With Quote
  #27 (permalink)
Shaban
Turin + Italy
 
Posts: 201 since Feb 2020
Thanks Given: 26
Thanks Received: 138


Fonz View Post
Here is what I have.
Hope this helps.

For Fonz: You have a P.M.


Reply With Quote




Last Updated on June 29, 2021


© 2026 NexusFi®, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Downloads - Top
no new posts