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 themeantrader with 3 posts (0 thanks)
    3. looks_3 canucck with 3 posts (1 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 21,803 views
    2. thumb_up 24 thanks given
    3. group 18 followers
    1. forum 26 posts
    2. attach_file 6 attachments




 
Search this Thread

Donchian Channel for EasyLanguage

  #11 (permalink)
 olobay 
Montreal
 
Experience: Intermediate
Platform: MultiCharts
Broker: DeepDiscountTrading.com
Trading: CL
Posts: 364 since Jul 2011


canucck View Post
Hi,

Thanks for replying. Unfortunately, TS can't import that kind of file. I appreciate your posting though.

Try this. Create a new indicator in Tradestation and paste this:

 
Code
Inputs:
	Period(14);

vars:
	Channel(0), iUpper(0), iLower(0);

iUpper = Highest(High, Period);
iLower = Lowest(Low, Period);
Channel = (iUpper + iLower) / 2;

Plot1(Channel, "Mean");
Plot2(iUpper, "Upper");
Plot3(iLower, "Lower");

Reply With Quote

Can you help answer these questions
from other members on NexusFi?
My NT8 Volume Profile Split by Asian/Euro/Open
NinjaTrader
New Micros: Ultra 10-Year & Ultra T-Bond -- Live Now
Treasury Notes and Bonds
NexusFi Journal Challenge - April 2024
Feedback and Announcements
Better Renko Gaps
The Elite Circle
Are there any eval firms that allow you to sink to your …
Traders Hideout
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Get funded firms 2023/2024 - Any recommendations or word …
60 thanks
Funded Trader platforms
37 thanks
NexusFi site changelog and issues/problem reporting
24 thanks
GFIs1 1 DAX trade per day journal
22 thanks
The Program
19 thanks
  #12 (permalink)
 canucck 
los angeles, ca
 
Experience: Beginner
Platform: TOS
Trading: stocks
Posts: 10 since Aug 2011
Thanks Given: 3
Thanks Received: 8

That works - thanks!

I see you are from Montreal - I used to work by the "Big O" at Christie Brown. Boy, I miss those smoked meat sandwiches from Schwartz's and the bagels from the Fauborg Marche!

Reply With Quote
Thanked by:
  #13 (permalink)
StevenD
Toronto, Ontario
 
Posts: 4 since Jan 2015
Thanks Given: 0
Thanks Received: 0


This is what I got when I tried to compile the code?


------ Build started: ------
Study: "Donchian Channel" (Indicator)
Please wait ....
------ Compiled with error(s): ------
Wrong expression
line 9, column 19


Help?

Reply With Quote
  #14 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,431 since Apr 2013
Thanks Given: 481
Thanks Received: 1,623

StevenD,

my guess is that you didn't import the file, but created a new indicator yourself. Importing the file will work fine and I'd suggest you do that. Otherwise post the full code that gives you trouble, as with only the error message it's hard to guess.

Regards,
ABCTG


StevenD View Post
This is what I got when I tried to compile the code?


------ Build started: ------
Study: "Donchian Channel" (Indicator)
Please wait ....
------ Compiled with error(s): ------
Wrong expression
line 9, column 19


Help?


Follow me on Twitter Reply With Quote
  #15 (permalink)
StevenD
Toronto, Ontario
 
Posts: 4 since Jan 2015
Thanks Given: 0
Thanks Received: 0

Got it....Thanks!

Reply With Quote
  #16 (permalink)
 ilu007 
New York + US
 
Experience: Intermediate
Platform: MultiCharts
Trading: Indian Stocks
Posts: 37 since Aug 2015
Thanks Given: 10
Thanks Received: 2

Thanks Big Mike...

What could be the possible strategies when Lets say close > x_bars

if I trade with 1 contract then how should I code Buy Entry, StopLoss, Short Entry..

Reply With Quote
  #17 (permalink)
 trade888 
Vancouver + Canada
 
Experience: Intermediate
Platform: Sierra
Trading: CL UB ES
Posts: 133 since Apr 2015
Thanks Given: 880
Thanks Received: 115

Multicharts.NET will not import a PLA file.
The Price Channel indicator in Multicharts.net does not have a mid line.
I adapted it to include the mid line.
(My first program in C#. Amazing what you can do with cut and paste and change variables)
____________________________

It appears we cannot upload a PLN file which is the format for the NET program

so here is the code;
open the Price Channel indicator in the editor and make the changes:

____________________________________

using System;
using System.Drawing;

namespace PowerLanguage.Indicator
{
[SameAsSymbol(true)]
public class Price_Channel_with_mid : IndicatorObject
{
private VariableSeries<Double> m_lowerband;

private VariableSeries<Double> m_upperband;

private VariableSeries<Double> m_midband;

private IPlotObject Plot1;

private IPlotObject Plot2;

private IPlotObject Plot3;

public Price_Channel_with_mid(object ctx) :
base(ctx){
length = 20;
}

[Input]
public int length { get; set; }

[Input]
public int displace { get; set; }

protected override void Create(){
m_lowerband = new VariableSeries<Double>(this);
m_upperband = new VariableSeries<Double>(this);
m_midband = new VariableSeries<Double>(this);
Plot1 =
AddPlot(new PlotAttributes("UpperBand", 0, Color.Yellow,
Color.Empty, 0, 0, true));
Plot2 =
AddPlot(new PlotAttributes("LowerBand", 0, Color.Yellow,
Color.Empty, 0, 0, true));
Plot3 =
AddPlot(new PlotAttributes("MidBand", 0, Color.Yellow,
Color.Empty, 0, 0, true));

}

protected override void CalcBar(){
m_lowerband.Value = Bars.Low.Lowest(length, 1);
m_upperband.Value = Bars.High.Highest(length, 1);
m_midband.Value = ((m_upperband.Value+m_lowerband.Value)/2);
if (((displace >= 0) || Bars.CurrentBar > Math.Abs(displace))){
Plot1.Set(displace, m_upperband.Value);
Plot2.Set(displace, m_lowerband.Value);
Plot3.Set(displace, m_midband.Value);
if ((displace <= 0)){
if (this.CrossesUnder(Bars.Low, m_lowerband)){
Alerts.Alert("Price making new low");
}
if (this.CrossesOver(Bars.High, m_upperband)){
Alerts.Alert("Price making new high");
}
}
}
}
}
}

Visit my NexusFi Trade Journal Reply With Quote
  #18 (permalink)
themeantrader
Towcester, United Kingdom
 
Posts: 3 since Feb 2021
Thanks Given: 0
Thanks Received: 0

Hi, I'm new to the forum and trying to learn EL as quick as I can using Multicharts. I'm trying to replicate my charts that I use in a another (now defunct account) software package.

I like the Price Channel in multicharts (but there is no MEAN) and I like the Donchian code posted by Big Mike. Ideally what I'm trying to do is add the option to displace which is on the Price Channel, but not in the Donchian Code. I've had a go at trying to merge the code from the two as best I can, but I'm getting errors. Any ideas would be gratefully appreciated. I just need to then add a HULL moving average which Multicharts also doesn't seem to have as standard!

Thanks in advance, TMT!

Reply With Quote
  #19 (permalink)
 
Fonz's Avatar
 Fonz 
Miami, Fl
 
Experience: Advanced
Platform: Tradestation, Jigsaw
Trading: Futures
Posts: 50 since Feb 2012
Thanks Given: 24
Thanks Received: 64

I think this is the Hull Moving Average for Multicharts.
Enjoy!

Attached Files
Elite Membership required to download: jtHMA.pla
Reply With Quote
Thanked by:
  #20 (permalink)
themeantrader
Towcester, United Kingdom
 
Posts: 3 since Feb 2021
Thanks Given: 0
Thanks Received: 0


Thanks, I managed to work out adding the MEAN, so just the HULL to go now, and then of course the long arduous task of learning EL to automate what's in my head!

Much appreciated.

Cheers

Reply With Quote




Last Updated on June 29, 2021


© 2024 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 - Privacy Policy - Downloads - Top
no new posts