NinjaTrader Support Forum  
X

Attention!

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


Go Back   NinjaTrader Support Forum > NinjaScript Development Support > Indicator Development

Indicator Development Support for the development of custom indicators using NinjaScript.

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Old 03-08-2010, 10:16 AM   #1
Roumeau
Junior Member
 
Join Date: Mar 2010
Posts: 7
Thanks: 0
Thanked 0 times in 0 posts
Default Help, I need somebody...

Hello,

I want to make an indicator but there is a big problem;

the idea is that when a situation occur, like a line cross above another, a variable, well let's call it flag, equals 1.
When an another situation occurs, the flag = -1.

The problem is that i've got to declare this variable, typically int flag = 0;
and when a situation on a bar a situation occurs, flag = 1 or -1, but the next bar, it equals 0 (due to the declaration).
I want that the value of flag remains until a new situation or event.

Is that possible? I knew that is possible in Strategy with user variable but in an indicator?

Thank U a lot!!!

(Sorry for my english!! )
Roumeau is offline  
Reply With Quote
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -6. The time now is 11:36 AM.