![]() |
This website will be down for maintenance from Friday May 24th at 6PM MDT until Saturday May 25th at 11AM MDT. We apologize for the inconvenience. If you need assistance during this time, please email sales@ninjatrader.com
|
|||||||
| Indicator Development Support for the development of custom indicators using NinjaScript. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Junior Member
Join Date: May 2010
Posts: 24
Thanks: 3
Thanked 0 times in 0 posts
|
i did the indicator on indicator tutorial and still can't get it to work. i do have it in strategy as
{ DrawLine("My line2" + CurrentBar, 1, EMA(21)[1] + (ATR(14)[1]) * (1 + 1), 0, EMA(21)[0] + (ATR(14)[0]) * (1 + 1), Color.Red); DrawLine("My line" + CurrentBar, 1, EMA(21)[1] + (ATR(14)[1]) * (1 + -3), 0, EMA(21)[0] + (ATR(14)[0]) * (1 + -3), Color.Green); } i'd love to turn this into a indicator, but i can't seem to get it to work. |
|
|
|
|
|
#2 | |
|
Senior Member
|
Quote:
|
|
|
|
|
|
|
#4 |
|
Junior Member
Join Date: May 2010
Posts: 24
Thanks: 3
Thanked 0 times in 0 posts
|
actually i get these errors if i try anything. if i edit a NT indicator and change the name and hit "compile" i get these same error messages. so clearly i have something larger going on here.
|
|
|
|
|
|
#5 | |
|
Senior Member
Join Date: Aug 2010
Location: Washington, D.C.
Posts: 1,187
Thanks: 178
Thanked 301 times in 259 posts
|
Quote:
I edit ADL, changed the name to A2DL (got warning "you can not save system indicators", ) and it compiled. [Description("The Accumulation/Distribution (AD) study attempts to quantify the amount of volume flowing into or out of an instrument by identifying the position of the close of the period in relation to that period�s high/low range.")] public class A2DL : Indicator { I created a new indicator, cut and pasted ADX into it, compiled as "MyCustomIndicator", OK, changed named to "MyCustomIndicator2", and that was fine too. market with low volumes whereas a cross above 20 may indicate the start of a trend (either up or down). If the ADX is over 40 and begins to fall, it can indicate the slowdown of a current trend.")] public class MyCustomIndicator2 : Indicator { #region Variables Please provide more detailed steps? I'm assuming latest NT7? I'm on 32bit. |
|
|
|
|
|
|
#6 |
|
Junior Member
Join Date: May 2010
Posts: 24
Thanks: 3
Thanked 0 times in 0 posts
|
NT 7.0.1000.6 32bit
i open up ADL do a "save as" change the name and hit "compile" and i get this error No overload for method 'Set' takes '6' arguments so not as many errors but still wont compile |
|
|
|
|
|
#7 | |
|
Senior Member
Join Date: Aug 2010
Location: Washington, D.C.
Posts: 1,187
Thanks: 178
Thanked 301 times in 259 posts
|
Quote:
I opened up ADL, right clicked in the code to "SAVE AS", changed to A2D, warned me about changing all occurrences of ADL (and it appeared to do it), and I hit the compile and it compiled. no errors. I didn't look at the .7 log change to see if anything related to this was fixed/changed. ![]() /// </summary> [Description("The Accumulation/Distribution (AD) study attempts to quantify the amount of volume flowing into or out of an instrument by identifying the position of the close of the period in relation to that period�s high/low range.")] public class a2d : Indicator { |
|
|
|
|
|
The following user says thank you to sledge for this post: |
|
|
|
#8 |
|
Junior Member
Join Date: May 2010
Posts: 24
Thanks: 3
Thanked 0 times in 0 posts
|
well you did what i did, exactly. and i got the error. thanks a bunch for trying that out for me.
|
|
|
|
|
|
#9 | |
|
Senior Member
|
Quote:
If I may make a suggestion: you might be better served if you would take things one step at a time, waiting for a response from those who are trying to help. I actually think that your first problem would have been resolved by now, if you had just responded to what was asked, instead of your trying new experiments. In this case, those new experiments may have introduced new nuances into what was originally a single problem. I am not being snide: I really do want to help.
|
|
|
|
|
|
|
#10 |
|
Junior Member
Join Date: May 2010
Posts: 24
Thanks: 3
Thanked 0 times in 0 posts
|
ok here are more complete looking results here
is there something there that shows whats up[ and not to be snarky but my fiddling seems to have uncovered that i am having a more comprehensive problem and not a small programming problem |
|
|
|
|
|
#11 | ||
|
Senior Member
|
Quote:
Quote:
In this case, it appears that it is possible that only the original problem still remains, but it appears to be showing up elsewhere. That is not really the case: NT compiles everything into one assembly, so any errors, no matter where they are, must be resolved before you can get a successful compilation. If you have one error, and you write new files, nothing will compile, and it is easy to think that you have multiple errors, when in fact, you still have the same one. OTOH, as all errors will prevent compilation, new files may have introduced new errors that are not yet showing. |
||
|
|
|
|
|
#12 |
|
Junior Member
Join Date: May 2010
Posts: 24
Thanks: 3
Thanked 0 times in 0 posts
|
ok. so i deleted all of the files and started over. first i tried to cut/paste from my working strategy (as in my original post), with the command "draw line", it compiled but would not draw anything on the chart.
so next i tried to add "plots" in the indicator generator then paste my declarations and i get this error HERE and when i click on the error code the "plot" is highlighted so if i understand the error code, i don't give enough info to plot my line, is that correct? |
|
|
|
|
|
#13 | |
|
Senior Member
|
Quote:
If you want to draw a line, then I go back to the very first question that I asked: "What error is in the log?" |
|
|
|
|
|
|
#14 | |
|
Junior Member
Join Date: May 2010
Posts: 24
Thanks: 3
Thanked 0 times in 0 posts
|
Quote:
ah right, sorry, i didn't understand. HERE is the log file |
|
|
|
|
|
|
#15 | |
|
Senior Member
|
Quote:
Try this. Place this line at the beginning of the OnBarUpdate() event handler. Code:
if (CurrentBar < 1) return; |
|
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| ATR indicator | christof21 | Indicator Development | 3 | 04-25-2010 12:14 PM |
| building a new ATR indicator | easypilot | Indicator Development | 1 | 06-20-2009 11:37 AM |
| Indicator for the SMA of the ATR | pureporsche | Indicator Development | 3 | 02-08-2009 11:45 AM |
| ATR Indicator | playafh69 | Indicator Development | 1 | 01-01-2009 10:28 PM |
| Simple ATR w/ EMA Indicator | tmoose | Indicator Development | 1 | 10-15-2008 08:21 AM |