![]() |
|
|||||||
| General Programming General NinjaScript programming questions. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Junior Member
|
I bought the BetterSinewavePB and SR from emini-watch.com.
They say that accessing the variables is very simple, however my coding was not able to bring them up. If anyone has experience with this program or his new programs let me know and I will share my code and you can tell me where I can make the corrections. They have turned me down on help with my code. Thanks, Don |
|
|
|
|
|
#2 |
|
Senior Member
Join Date: Nov 2008
Posts: 186
Thanks: 38
Thanked 32 times in 26 posts
|
Not sure what you are asking... do you want to find the value of a specific plot at a specific bar?
|
|
|
|
|
|
#3 |
|
Junior Member
|
These are the indicator outputs the seller says that I should be able to get.
Use these variables to access public values/states for Better Sine Wave indicators: BetterSinewave.Sine[BarsAgo] BetterSinewave.LeadSine[BarsAgo] BetterSineSR.Support[BarsAgo] BetterSineSR.Resistance[BarsAgo] BetterSineSR.BreakLo[BarsAgo] BetterSineSR.BreakHi[BarsAgo] BetterSineSR.PullBackSeries[BarsAgo] BetterSineSR.EndOfTrendSeries[BarsAgo] BetterSinePB.TrendSeries[BarsAgo] (UpTrend +1, DownTrend -1, NoTrend 0) I can send you my program if that helps. #region Using declarations using System; using System.ComponentModel; using System.Diagnostics; using System.Drawing; using System.Drawing.Drawing2D; using System.Xml.Serialization; using NinjaTrader.Cbi; using NinjaTrader.Data; using NinjaTrader.Gui.Chart; #endregion namespace NinjaTrader.Indicator { //================================================== ============== [Description("Gets the 'TrendSeries' .")] public class dbBSWGet : Indicator { private BetterSinePB sig3; //BetterSine PB is part of Trend direction. //================================================== ============== #region Variables // True/False Inputs to show arrows. private bool showBetterSinePB = false; // 1a (B) Arrows Up/Dn BarC // BetterSinePB Bar Trend Series private string bswPassword; private DataSeries trendSeries; // TrendSeries = +1 #endregion //================================================== ============== protected override void Initialize() { trendSeries = new DataSeries(this); // This is the BetterSinePB Trend Number. Overlay = true; // This should draw Plots on the Chart Panel. DrawOnPricePanel = true; CalculateOnBarClose = true; } //================================================== ============== protected override void OnStartUp() { sig3 = BetterSinePB(Color.Red,bswPassword,Color.Green); } protected override void OnBarUpdate() { if(CurrentBar<1) return; // ------------------- Logic for BetterSineWave Arrows ------------------- if( showBetterSinePB == true) { // double d = sig3.TrendSeries[0] ; // BetterSinePB (Take out'//' at left) } } #region Properties // ------- Data Series -------- // [XmlIgnore()] [Browsable(false)] public DataSeries TrendSeries { get { return trendSeries; } set { trendSeries = value;} } // BetterSinePB [Description("Enter your Password.")] [Category("2 - Better SineWave Input")] [Gui.Design.DisplayName(" Your Password")] public string BswPassword { get { return bswPassword; } set { bswPassword = value;} } #endregion } } If you have the BetterSinePB you can probably paste this code into a new indicator and see what I see. Need to take out the '//' at line 58 and I get the error CS1061 that says: 'NinjaTrader.Indicator.BetterSinePB' does not contain a definition for 'TrendSeries' Thanks, Don |
|
|
|
|
|
#4 |
|
Junior Member
|
Here's my .cs. Beware that I did get a strange message saying you would need access to 5 other files which don't involve the cs that i'm sending. Never got that message before.
If it won't work. It's really easy to paste into a new Indicator. I've done it many times. Let me know if it imports for you. I can walk you through the procedure if necessary. dbl |
|
|
|
|
|
#5 |
|
Senior Member
Join Date: Nov 2008
Posts: 186
Thanks: 38
Thanked 32 times in 26 posts
|
Got it. Successfully imported despite warnings...
I'll play around with it and get back to you. |
|
|
|
|
|
#6 | |
|
Senior Member
|
Quote:
|
|
|
|
|
|
|
#7 | |
|
Senior Member
Join Date: Nov 2008
Posts: 186
Thanks: 38
Thanked 32 times in 26 posts
|
Quote:
Code:
double test = BetterSinePB(Color.Red,Password,Color.Green).TrendSeries[0]; |
|
|
|
|
|
|
#8 |
|
Senior Member
|
Same error; same reason. TrendSeries is not an entity in BetterSinePB: it is a DataSeries defined in the current class.
|
|
|
|
|
|
#9 |
|
Senior Member
Join Date: Nov 2008
Posts: 186
Thanks: 38
Thanked 32 times in 26 posts
|
Thanks for looking into this, Koganam,
Even when I comment out the TrendSeries language in the original posters script... including the properties it won't compile. The instructions from the indicator vendor are that TrendSeries is a public property of BetterSinePB. He gives a similar public property for his related indicator BetterSineWave of BetterSineWave.Sine. This compiles: Code:
double test = BetterSinewave(password,true).Sine[0]; The vendor gives BetterSinePB.TrendSeries[barsAgo] as the instructions for retrieving the public property TrendSeries from BetterSinePB.
Last edited by Crassius; 04-25-2012 at 05:15 PM.
|
|
|
|
|
|
#10 | |
|
Senior Member
|
Quote:
The OP should not ask for help with his code from the author; that is probably why he is not responding. Instead he should state that he is getting an error trying to access a property that the author claims is exposed. A lot of programmers that I know refuse to look at another person's code, just so they do not get hit with copyright issues. (Basically, the attitude is: "If I never saw your code, you cannot later claim that I stole it.") |
|
|
|
|
|
The following user says thank you to koganam for this post: |
|
|
|
#11 |
|
Senior Member
Join Date: Nov 2008
Posts: 186
Thanks: 38
Thanked 32 times in 26 posts
|
I made a new indicator to test the two public properties:
Code:
protected override void OnBarUpdate()
{
betterSineWaveSine = BetterSinewave(password,true).Sine[0];
Print(betterSineWaveSine);
//betterPBTrend = BetterSinePB(Color.Red,password,Color.Green).TrendSeries[0];
//Print(betterPBTrend);
}
Does not contain definition for... |
|
|
|
|
|
#12 | |
|
Senior Member
Join Date: Nov 2008
Posts: 186
Thanks: 38
Thanked 32 times in 26 posts
|
Quote:
Yes, I think that is the case.... the property is SUPPOSED to be public but there is an error in the vendors script and that property is not exposed... I know the vendor, Barry, is not a C# programmer and hired a NinjaScript consultant to translate his original EasyLanguage code, so he wouldn't know if it is exposed properly or not by looking at the code. I suggest the OP contact Barry and let him know that this has been looked into by more than just the OP and it appears to us that the property is not exposed and is not working as advertised. |
|
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Variables | Shannon Brandt | Strategy Development | 1 | 10-13-2011 10:40 AM |
| Variables | Italy | General Programming | 1 | 11-25-2010 08:47 AM |
| How to access MACD variables in the Wizard | laocoon | Strategy Development | 9 | 07-03-2010 12:47 AM |
| Can I access Public Indicator Variables from Strategy | rrv1980 | Strategy Development | 13 | 08-24-2008 05:31 PM |
| Access to price data variables in user defined class | svrz | Indicator Development | 2 | 05-21-2008 10:48 PM |