![]() |
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
|
|||||||
| Charting Support for NinjaTrader Advanced Charting. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Junior Member
|
Hi,
if I want to put an alert in my indicator (I'm not yet advanced enough to start programming strategies) for a possible entry, will the alert sound repeatedly on each new OnBarUpdate() as long as the possible entry is valid? Can I use a static or saved variable in the indicator so that my alert will only sound once for each possible new signal, ie "alert already sent for this signal, dont do it again", and then when the possible entry is void the variabe is reset, then set again only after the next possible entry? Also, I have 2 questions on strategies. 1. are there any strategy samples that I can study to understand the process? 2. is it possible to create an interface to control a strategy? for example I may want to start/stop/pause my strategy using a button. I would also like to be able to update my strategy with support and resistance levels while it is running, so on my interface i would be able to enter a support or resistance level and 'submit' to my strategy on the fly. Thanks, Will. |
|
|
|
|
|
#2 |
|
NinjaTrader Customer Service
Join Date: Sep 2008
Location: Germany
Posts: 22,414
Thanks: 252
Thanked 977 times in 960 posts
|
Hi dontpanic, you could designate a number # of seconds after the which the alert would be rearmed :
http://www.ninjatrader.com/support/h.../nt7/alert.htm There are several strategies provided per default with NT, such as the SampleMACrossover and SampleAtmStrategy which you could review for code examples. Another good place to start is the wizard : http://www.ninjatrader.com/support/h...egy_wizard.htm Using buttons for strategy start / pausing would unfortunately not be supported, you could enable / disable the strategy via the strategies tab as needed.
Bertrand
NinjaTrader Customer Service |
|
|
|
|
|
#3 |
|
Junior Member
|
Does Ninjatrader 7 support c# shared memory? this would be a way to interact with the strategy. I want to be able to interactively give my strategy support and resistance levels without having to start and stop it.
Are there any more complex strategy examples? I'm looking for something that will show me how to properly manage a trade, not just make the entry. Thanks, Will. |
|
|
|
|
|
#4 |
|
NinjaTrader Customer Service
Join Date: Sep 2008
Location: Germany
Posts: 22,414
Thanks: 252
Thanked 977 times in 960 posts
|
Hi Will, unfortunately the strategies are not designed to interact / cross communicate - some customers have found success using for example the Global Variable dll that floats around here in the forum, but we could not offer support for this area.
For more complex trade management, please see for example : http://www.ninjatrader.com/support/f...ead.php?t=7499
Bertrand
NinjaTrader Customer Service |
|
|
|
|
|
#5 |
|
Junior Member
|
Hi,
I just tried adding into the variables section in the indicator :- static int counter=0; then incremented and printed in OnBarUpdate(); the count works, but the initialise did not seem to. For example on a 144 tick chart the first printed value was 2645, and 1126 on a 5min chart. The fact that the increment works and the static value is saved is enough for me to work with, but is there a reason why it does not (appear to) initialise correctly? Also tried initialising in the Intialise() function of the indicator. Also, what version of c# and .NET are supported in NT7? Thanks again. |
|
|
|
|
|
#6 |
|
NinjaTrader Customer Service
Join Date: Sep 2008
Location: Germany
Posts: 22,414
Thanks: 252
Thanked 977 times in 960 posts
|
Will, NT7 would work with .NET 3.5 per default - using static variables is unfortunately not supported by us - if you would like to expose a non plotted / internal variable in an indicator please see this example we provide :
http://www.ninjatrader.com/support/f...ead.php?t=4991
Bertrand
NinjaTrader Customer Service |
|
|
|
|
|
#7 |
|
Junior Member
|
Hi,
please ignore the below re WCF, it now compiles after importing the .dll. Firstly, I discovered that using static variables works. The only limitation is that each chart that uses my indicator uses the SAME static variable, so I had to create a static array and set each chart to use a different array index by creating a user input chart variable. Awkward, but it works. Now I'm trying use Windows Communication Foundation (WCF) to talk to my indicator. WCF is supported in .NET 3.0 and greater, so shouldn't it work in NT? I'm running into problems right from the start, since the NT compiler wont recognise the reference. I included this reference : using System.ServiceModel; The compiler says : The type or namespace name "ServiceModel" could not be found. Are you missing... Why would the compiler not recognise this? Thanks, will.
Last edited by dontpanic; 06-23-2011 at 12:03 AM.
Reason: Found Answer Myself
|
|
|
|
|
|
#8 |
|
NinjaTrader Customer Service
Join Date: Sep 2008
Location: Germany
Posts: 22,414
Thanks: 252
Thanked 977 times in 960 posts
|
Will, I'm unfortunately not familair with this DLL, have you tried adding a reference in the NinjaScript editor directly via a right click in the code?
Bertrand
NinjaTrader Customer Service |
|
|
|
![]() |
| Tags |
| static variables |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Indicators in Static Super DOM | cre8it8 | SuperDOM and other Order Entry Windows | 6 | 04-12-2010 12:23 PM |
| private static variables are shared? | roland_nt | Indicator Development | 3 | 03-25-2010 03:43 PM |
| optimizing on a static variables | billitin | Suggestions And Feedback | 6 | 10-16-2008 08:07 AM |
| Can indicators return values other than Plot values? | higler | General Programming | 2 | 04-29-2008 05:17 AM |
| Reference variables for indicators | cls71 | General Programming | 4 | 03-12-2008 01:56 AM |