![]() |
|
|||||||
| Indicator Development Support for the development of custom indicators using NinjaScript. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#16 |
|
Junior Member
Join Date: Jul 2007
Posts: 8
Thanks: 0
Thanked 0 times in 0 posts
|
Thanx much also Gump, I looked at your code and found one improvement I could make to mine.
|
|
|
|
|
|
#17 | |
|
Administrator
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,163
Thanks: 6
Thanked 45 times in 32 posts
|
Quote:
Welcome aboard!
Ray
NinjaTrader Customer Service |
|
|
|
|
|
|
#18 |
|
Senior Member
Join Date: Apr 2007
Location: , ,
Posts: 150
Thanks: 0
Thanked 0 times in 0 posts
|
I have also switched from Tradestation to Ninjatrader and I'm glad I did.
It also took me a while to get familiar with ninjascript (and I'm still working on it, C# is new for me too) but it is WAY more powerful than Tradestation EL. I still feel that the very simple things are more quickly implemented in EL than in NTscript, however the more complicated stuff is easier in NTscript. One of the reasons is that you can structure your code much better in NTscript than in EL. For the people who need more indicators, maybe a seperate section in this supportforum can be setup where NT users can share their indicators. Personally I prefer that the developers at Ninjatrader company focus on debugging and adding new features to NT instead of translating hundreds of indicators. |
|
|
|
|
|
#19 |
|
Senior Member
Join Date: Jul 2007
Posts: 176
Thanks: 0
Thanked 0 times in 0 posts
|
Hello, Would it be possible for NinjaTrader to create the Tim Tillson's T3 Moving Average Indicators...the T3, T5 and T8. They are fairly common indicators. I would like to be able to then create a crossover strategy using the T3's not unlike the "Sample moving average crossover" strategy provided in your strategies folder. Maybe you could make just the one indicator and be able to adjust the periods instead of making three seperate indicators. I just need to have them seperate to create the crossover strategy.
A version of the indicator is located at http://www.amibroker.com/library/detail.php?id=852. Another sample is in Metastock code:This is the 3 period: e1:=Mov(C,3,E); e2:=Mov(e1,3,E); e3:=Mov(e2,3,E); e4:=Mov(e3,3,E); e5:=Mov(e4,3,E); e6:=Mov(e5,3,E); c1:=-.7*.7*.7; c2:=3*.7*.7+3*.7*.7*.7; c3:=-6*.7*.7-3*.7-3*.7*.7*.7; c4:=1+3*.7+.7*.7*.7+3*.7*.7; c1*e6+c2*e5+c3*e4+c4*e3; Thanks for your help. |
|
|
|
|
|
#20 |
|
Administrator
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,163
Thanks: 6
Thanked 45 times in 32 posts
|
Hi,
I will add this request to our list of features for future consideration. I can not guarantee if and when we could accomodate this request at this time.
Ray
NinjaTrader Customer Service |
|
|
|
|
|
#21 |
|
Senior Member
Join Date: Jul 2007
Posts: 176
Thanks: 0
Thanked 0 times in 0 posts
|
If anyone in this forum knows how to write of convert the code below for the T3's it would be greatly appreciated. I also have attached the code from eSignal. Maybe it can help.
// NOTE: // This efs requires amStudies.efsLib in the FunctionLibrary folder. // If you do not have this file you can download it at the link below. // http://share.esignal.com/groupconten...ies&groupid=10 var fpArray = new Array(); function preMain() { setPriceStudy(true); setStudyTitle("T3 MA"); setCursorLabelName("T3",0); setDefaultBarFgColor(Color.blue,0); setPlotType(PLOTTYPE_LINE,0); setDefaultBarThickness(1,0); askForInput(); var x=0; fpArray[x] = new FunctionParameter("Length", FunctionParameter.NUMBER); with(fpArray[x++]){ setLowerLimit(1); setDefault(6); } fpArray[x] = new FunctionParameter("Factor", FunctionParameter.NUMBER); with(fpArray[x++]){ setUpperLimit(1); setLowerLimit(0); setDefault(0.7); } fpArray[x] = new FunctionParameter("Source", FunctionParameter.STRING); with(fpArray[x++]){ addOption("open"); addOption("high"); addOption("low"); addOption("close"); addOption("hl2"); addOption("hlc3"); addOption("ohlc4"); setDefault("close"); } fpArray[x] = new FunctionParameter("Symbol", FunctionParameter.STRING); with(fpArray[x++]){ setDefault(); } fpArray[x] = new FunctionParameter("Interval", FunctionParameter.STRING); with(fpArray[x++]){ setDefault(); } fpArray[x] = new FunctionParameter("Offset", FunctionParameter.NUMBER); with(fpArray[x++]){ setDefault(0); } fpArray[x] = new FunctionParameter("Params", FunctionParameter.BOOLEAN); with(fpArray[x++]){ setName("Show Parameters"); setDefault(false); } } var amLib = addLibrary("amStudies.efsLib"); var bInit = false; var xT3 = null; function main(Length,Factor,Source,Symbol,Interval,Offset,P arams) { if(bInit == false){ with( amLib ) { if(Symbol == null) Symbol = getSymbol(); if(Interval == null) Interval = getInterval(); var vSymbol = Symbol+","+Interval; xT3 = offsetSeries(amT3(Length,Factor,eval(Source)(sym(v Symbol))),Offset); setShowTitleParameters(eval(Params)); bInit = true; } } return getSeries(xT3); } |
|
|
|
|
|
#22 |
|
Senior Member
Join Date: Jun 2007
Posts: 218
Thanks: 0
Thanked 1 time in 1 post
|
Dwalls,
What sort of moving average do these indicators need? The original AmiBroker code you posted specifies "Mov", while the link on AmniBroker specifies "AMA" (is that the same as KAMA?). Also on the T3 the code you posted uses "0.7" whereas the link specifies "5". So we need to make that value a parameter, but what is it? Answer these questions and perhaps a screenshot and it should be pretty simple to knock up. |
|
|
|
|
|
#23 |
|
Certified NinjaScript Consultant
|
Fwiw, most traders that I know that use to work with the T3 or some derivation, including myself, have since switched to using the Hull Moving Average or HMA which is already available as a standard indicator. At the time that I switched (using another platform) I recall convincing myself that the HMA was smoother yet exhibited less lag than the T3 indicator for my applications. Your mileage may vary.
Regards, Whitmark |
|
|
|
|
|
#24 |
|
Senior Member
Join Date: Jul 2007
Posts: 176
Thanks: 0
Thanked 0 times in 0 posts
|
Gumphrie,
Here is another similar formula I found: Description: Trading system based on cubing of function (1+a)-ax^2 where a is the amplification ( 0 < a < 1.0, I use 0.7) and en is the exponentially smoothed average of the closing price. Formula: /* T3 trading system */ a = 0.7; n = 2; alpha = 2/(n + 1); e1 = ema(close, n); e2 = ema (e1, n); e3 = ema (e2, n); e4 = ema (e3, n); e5 = ema (e4, n); e6 = ema (e5, n); T3 = -a^3 * e6 + (3 * a^2 +3 * a^3) * e5 + (-6 * a^2 - 3 * a - 3 * a^3) * e4 + (1 + 3 * a + a^3 + 3 * a^2) * e3; graph0 = close; graph1 = T3; SELL = cross ( Close, T3 ); BUY = cross (T3, Close ); SHORT = cross ( Close, T3); COVER = cross (T3, Close ); Maybe this will help you.Thanks for your help. |
|
|
|
|
|
#25 |
|
Senior Member
Join Date: Jun 2007
Posts: 218
Thanks: 0
Thanked 1 time in 1 post
|
Dwalls,
Is this correct? (find attached). Don't forget to compile it in the Ninjascript Indicator ediror after placing it in "My Documents\NinjaTrader 6\bin\Custom\Indicator" - attachment removed -
Last edited by Gumphrie; 07-12-2007 at 02:04 AM.
|
|
|
|
|
|
#26 |
|
Administrator
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,163
Thanks: 6
Thanked 45 times in 32 posts
|
Thanks for contributing Gumphrie!
Did you know that you can export a script via File > Utilities > Export NinjaScript ? This creates a zip file that people can then import which automatically compiles.
Ray
NinjaTrader Customer Service |
|
|
|
|
|
#27 |
|
Senior Member
Join Date: Jul 2007
Posts: 176
Thanks: 0
Thanked 0 times in 0 posts
|
Gumphrie,
Thanks for your help. It is suppose to be an overlay of price just like any other moving average. I attached a screen shot of the indicator on eSignal. The yellow line is the 3 period and the white line is the 5 period. I cant seem to get a picture of the eSignal Study Properties so I will type them out: Parameter Value Default Lenght1 5 5 Lenght2 3 3 Factor 0.7 0.7 Source close close Symbol n/a n/a Interval n/a n/a Offset 0 0 Show Parameters false false Linecolor1 white white Linecolor2 yellow yellow I hope this helps. Thanks again. |
|
|
|
|
|
#28 |
|
Administrator
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,163
Thanks: 6
Thanked 45 times in 32 posts
|
You can add the line within the Initialize() method:
Overlay = true; and then recompile or; When adding the indicator to the chart, just change the panel property to a value of 1.
Ray
NinjaTrader Customer Service |
|
|
|
|
|
#29 |
|
Senior Member
Join Date: Jul 2007
Posts: 176
Thanks: 0
Thanked 0 times in 0 posts
|
Thanks NinjaTrader Ray,
When I did as you suggested, the chart flatlines. I can see the red indicator line well below price, its way down there and flatlined. I also added the also: PriceTypeSupported = true; and that didnt help either. Thanks for your help. |
|
|
|
|
|
#30 |
|
Senior Member
Join Date: Jun 2007
Posts: 218
Thanks: 0
Thanked 1 time in 1 post
|
Thought that would happen (which is why a screenshot helps).
Try the attached version. The zip file is a NinjaScript export file.
Last edited by Gumphrie; 07-12-2007 at 02:20 AM.
|
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Ratcheting Indicators | sknudsen | Strategy Analyzer | 1 | 05-21-2007 08:08 PM |
| Indicators | nelson | Charting | 1 | 05-21-2007 11:00 AM |
| Indicators value on the current bar | Paolo333 | Charting | 8 | 05-08-2007 09:14 AM |
| KwikPop Indicators | BradB | Automated Trading | 1 | 04-03-2007 03:26 AM |
| TTM Indicators | Freddie | Indicator Development | 1 | 03-11-2007 06:28 AM |