![]() |
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
|
|||||||
| General Programming General NinjaScript programming questions. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Junior Member
Join Date: Dec 2008
Posts: 15
Thanks: 0
Thanked 0 times in 0 posts
|
I am stuck on what looks to be a straight forward variable assignment. Here is the code:
#region Variables private double wmR = -50.0; // WilliamsM private int WMRvar = 14; // WilliamsM var #endregion /// <summary> protected override void Initialize() { CalculateOnBarClose = true; } /// <summary> protected override void OnBarUpdate() { PrintWithTimeStamp("wmR: " + wmR); The output window shows: 4/9/2009 1:00:00 PM wmR: 1 I have been recompiling and reloading Ninjascript in the chart to test. WTF
|
|
|
|
|
|
#2 |
|
Certified NinjaScript Consultant
Join Date: Sep 2006
Location: New York, USA
Posts: 774
Thanks: 1
Thanked 7 times in 5 posts
|
Two thoughts.
1. Is this an input? If so, are you using something like Math.Max(value,1) on the input assignment? 2. Its good practice to do wmR.ToString() when printing a variable string. hope this helps.
"You look closely enough, you can find everything has a ... weak spot where it can break, sooner or later"
PureLogikTrading |
|
|
|
|
|
#3 |
|
Junior Member
Join Date: Dec 2008
Posts: 15
Thanks: 0
Thanked 0 times in 0 posts
|
Thanks mrlogik,
I tried wmR.ToString(), with no change. This is an input so I tried changing the max value to -100, and that worked. set { wmR = Math.Max(-100, value); } Thanks again. |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Variable input? | ju1234 | Strategy Development | 3 | 11-24-2008 09:15 AM |
| Passing variable | caldolegare | General Programming | 6 | 11-17-2008 09:23 AM |
| Assigning indicator values | ericadam | Strategy Development | 1 | 09-06-2008 11:19 PM |
| Global Variable... | maxpi | Strategy Development | 6 | 11-26-2007 09:47 PM |
| Assigning port numbers for three or more IB TWS instances | JangoFolly | Connecting | 6 | 11-29-2006 01:33 AM |