Dark Theme
Light Theme
Trading Articles
Article Categories
Article Tools
Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now for Free
Genuine reviews from real traders, not fake reviews from stealth vendors
Quality education from leading professional traders
We are a friendly, helpful, and positive community
We do not tolerate rude behavior, trolling, or vendors advertising in posts
We are here to help, just let us know what you need
You'll need to
register in order to view the content of the threads and start contributing to our community.
It's free for basic access, or support us by becoming an Elite Member -- see if you qualify for a discount below.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
Convert MQ4 to Ninjatrader
Updated October 14, 2015
trending_up
5,096 views
thumb_up
15 thanks given
group
3 followers
forum
14 posts
attach_file
8 attachments
Convert MQ4 to Ninjatrader
October 11th, 2015, 06:11 AM
Overijssel
Experience: Master
Platform: Ninja
Trading: FDAX
Posts: 15 since Aug 2010
Thanks Given: 4
Thanks Received: 2
I need help tot convert a MQ4 indicator tot Ninjatrader format.
Thanks for helping me:
//+------------------------------------------------------------------+
//| Chande_Kroll_Stop_v1.mq4 |
//| Copyright © 2006, Forex-TSD.com |
//| Written by IgorAD,[email protected] |
//| http://finance.groups.yahoo.com/group/TrendLaboratory |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2006, Forex-TSD.com "
#property link "http://www.forex-tsd.com/"
//----
#property indicator_chart_window
#property indicator_buffers 2
#property indicator_color1 Blue
#property indicator_color2 Red
//---- input parameters
extern int Length =20;
extern int ATRPeriod =10;
extern double Kv =3;
//---- indicator buffers
double UpTrend[];
double DnTrend[];
double smin[];
double smax[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
string short_name;
//---- indicator line
SetIndexStyle(0,DRAW_LINE);
SetIndexStyle(1,DRAW_LINE);
IndicatorBuffers(4);
SetIndexBuffer(0,UpTrend);
SetIndexBuffer(1,DnTrend);
SetIndexBuffer(2,smin);
SetIndexBuffer(3,smax);
//---- name for DataWindow and indicator subwindow label
short_name="Chande Kroll Stop("+Length+","+ATRPeriod+","+Kv+")";
IndicatorShortName(short_name);
SetIndexLabel(0,"UpTrend");
SetIndexLabel(1,"DnTrend");
//----
SetIndexDrawBegin(0,Length);
SetIndexDrawBegin(1,Length);
//----
return(0);
}
//+------------------------------------------------------------------+
//| Chande_Kroll_Stop_v1 |
//+------------------------------------------------------------------+
int start()
{
int shift,limit, counted_bars=IndicatorCounted();
//----
if(counted_bars > 0) limit=Bars-counted_bars;
if(counted_bars < 0) return(0);
if(counted_bars ==0) limit=Bars-Length-1;
//----
for(shift=limit;shift>=0;shift--)
{
smin[shift]=High[Highest(NULL,0,MODE_HIGH,ATRPeriod,shift)] - Kv*iATR(NULL,0,ATRPeriod,shift);
smax[shift]=Low [Lowest (NULL,0,MODE_LOW ,ATRPeriod,shift)] + Kv*iATR(NULL,0,ATRPeriod,shift);
//
UpTrend[shift]=-10000000;
DnTrend[shift]= 10000000;
//----
for(int i=Length-1;i>=0;i--)
{
UpTrend[shift]=MathMax( UpTrend[shift], smin[shift+i]);
DnTrend[shift]=MathMin( DnTrend[shift], smax[shift+i]);
}
}
return(0);
}
//+------------------------------------------------------------------+
Can you help answer these questions from other members on NexusFi?
Best Threads (Most Thanked) in the last 7 days on NexusFi
October 11th, 2015, 11:48 AM
Manta, Ecuador
Site Administrator Developer Swing Trader
Experience: Advanced
Platform: Custom solution
Broker: IBKR
Trading: Stocks & Futures
Frequency: Every few days
Duration: Weeks
Posts: 50,469 since Jun 2009
Thanks Given: 33,247
Thanks Received: 101,669
You are likely to have better luck posting in the "Want your NT indicator created free" thread:
But you need to include at least a couple charts, so people can reference them.
Mike
October 12th, 2015, 04:43 PM
Berlin, Europe
Market Wizard
Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker: Interactive Brokers
Trading: Keyboard
Posts: 9,888 since Mar 2010
Thanks Given: 4,242
Thanks Received: 27,103
I had a quick look at the formula and then produced a first version for NinjaTrader .
The chart is shown below.
Could you please compare it to a MetaTrader chart in order to confirm that it looks right?
If it is correct, I will finish the indicator and publish it in the downloads.
October 12th, 2015, 05:02 PM
Berlin, Europe
Market Wizard
Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker: Interactive Brokers
Trading: Keyboard
Posts: 9,888 since Mar 2010
Thanks Given: 4,242
Thanks Received: 27,103
The Chandelier Stop is based on a similar concept.
However, it does not require a lookback period for determining the highest high and lowest low, as it uses the highest high since the last trend change.
The chart below shows a comparison between the Chande-Kroll Stop and the Chandelier Stop (which was used by systems trader Charles LeBeau and has nothing to do with Tushar Chande).
October 13th, 2015, 02:30 AM
Overijssel
Experience: Master
Platform: Ninja
Trading: FDAX
Posts: 15 since Aug 2010
Thanks Given: 4
Thanks Received: 2
Hi Fat Tails,
Yes this looks greath. 100% Perfect.
Thanks for helping the code converting.
Chade kroll stop are a very good indicator. I could find it for Ninjatrader .
Thanks again.
Martien
October 13th, 2015, 05:17 AM
Berlin, Europe
Market Wizard
Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker: Interactive Brokers
Trading: Keyboard
Posts: 9,888 since Mar 2010
Thanks Given: 4,242
Thanks Received: 27,103
Realtimetrader
Hi Fat Tails,
Yes this looks greath. 100% Perfect.
Thanks for helping the code converting.
Chade kroll stop are a very good indicator. I could find it for
Ninjatrader .
Thanks again.
Martien
If you found it, was the ATR calculation based on a SMA of the true range (as Chande & Kroll) or was it based on an exponential moving average (classic or Wilder)?
October 13th, 2015, 05:35 AM
Overijssel
Experience: Master
Platform: Ninja
Trading: FDAX
Posts: 15 since Aug 2010
Thanks Given: 4
Thanks Received: 2
Fat Tails
If you found it, was the
ATR calculation based on a
SMA of the true
range (as Chande & Kroll) or was it based on an exponential
moving average (classic or Wilder)?
I've used in the past ProRealTime. In that program are the Chande Kroll Stop indicator.
https://www.prorealtime.com/en/
I can not give 100% certainty answer your question. What I do know is that the lines of this Chande Kroll Stop sometimes suddenly comes to lie above or below the rates. This is often a signal for a trend change. I have often thought that this indicator ProRealTime volume was related.
You can take a free subscription (day close dates) on ProRealTime to see the version of this Chande Kroll Stop.
I will send you a screenshot of it (Prorealtime)
Send you later.
October 13th, 2015, 05:43 AM
Overijssel
Experience: Master
Platform: Ninja
Trading: FDAX
Posts: 15 since Aug 2010
Thanks Given: 4
Thanks Received: 2
Realtimetrader
I've used in the past ProRealTime. In that program are the Chande Kroll Stop indicator.
https://www.prorealtime.com/en/
I can not give 100% certainty answer your question. What I do know is that the lines of this Chande Kroll Stop sometimes suddenly comes to lie above or below the rates. This is often a signal for a trend change. I have often thought that this indicator ProRealTime volume was related.
You can take a free subscription (day close dates) on ProRealTime to see the version of this Chande Kroll Stop.
I will send you a
screenshot of it (Prorealtime)
Send you later.
October 13th, 2015, 08:05 AM
Berlin, Europe
Market Wizard
Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker: Interactive Brokers
Trading: Keyboard
Posts: 9,888 since Mar 2010
Thanks Given: 4,242
Thanks Received: 27,103
The NinjaTrader chart looks similar. I will finish the indicator and post it.
October 13th, 2015, 08:13 AM
Overijssel
Experience: Master
Platform: Ninja
Trading: FDAX
Posts: 15 since Aug 2010
Thanks Given: 4
Thanks Received: 2
Fat Tails
The
NinjaTrader chart looks similar. I will finish the indicator and post it.
Oke thanks for progam this indicator. I am with this !!!!
Greatings,
Martien
Last Updated on October 14, 2015