PDA

View Full Version : Indicators freezing


blarouche
12-21-2009, 08:45 AM
Hi all

I have a problem with a few indicators. I don't know if it is a problem with NT7 or my code. Here is the situation :

I have created indicators that do reference other indicators. I also have two time frames. 1 minute and 50 ticks.

Sometimes they work without any problems but some day they just freeze everything on the screen.
No error messages seen. I also looked at the trace file and nothing appears there to give me some clue.

If I look at the Windows Task Manager under the Performance Tab I see that the CPU Usage just falls to 0% and that's it. To exit NT7 I have to go to the application Tab pick Control Center and End Task.


Have you heard about similar problem. What do you think I should be looking for

Thanks

Bernard

NinjaTrader_Austin
12-21-2009, 09:37 AM
Bernard, would it be possible for you to post the code to the indicators so we can at least try it out?

blarouche
12-21-2009, 09:42 AM
Austin

My smallest file have 600 lines of code

What can I do ?


Bernard

blarouche
12-21-2009, 09:45 AM
Maybe I'll try to post small part of code where I think that it could be a problem


Bernard

blarouche
12-21-2009, 10:11 AM
First of all I would like to know if referencing another indicator ( indicator vs indicator) is OK.

I am doing a lot of these relationship between strategies and indicators. That should be OK because some times it works !


if((NT7utilTail10M(12).T1Bull && Low[0] <= NT7utilTail10M(12).TailTriggerHigh)) {

if((NT7SquatBar(true,10,2).SellSquatTriggered[0] || (NT7PaintBars().Bar_Color > 0 && SellingBar())) && (High[0] < LastBuyLevel || Low[0] < LastBuyStop)
&& GetLowCount() >= 10 && ((High[0]-Low[0])/TickSize) <= maxRange){
if(BullFilterSetup){
BuyOrder = High[0];
BuyStop = Low[0];
BuyAlert = true;
}
}


}

NinjaTrader_Austin
12-21-2009, 10:11 AM
Bernard, thank you. You could always email it to support @ ninjatrader . com attention "austin - thread 23949".

NinjaTrader_Austin
12-21-2009, 10:13 AM
Sorry, our messages crossed in cyberspace. But yes, referencing an indicator from an indicator is not a problem.

blarouche
12-21-2009, 10:21 AM
Austin

That line of code shouldn't be a problem :


if(display_mode == Mode.Realtime_Only && Historical){
return;
}

blarouche
12-21-2009, 10:23 AM
I've got that in my Initialize() method :

//decimalPointLocation = NT7Assistant().Decimal_Point_Location;
switch(decimalPointLocation){
case 0 :
decimalpoint = "{0:0}";
break;

case 1 :
decimalpoint = "{0:0.0}";
break;

case 2 :
decimalpoint = "{0:0.00}";
break;

case 3:
decimalpoint = "{0:0.000}";
break;

case 4:
decimalpoint = "{0:0.0000}";
break;

default :
decimalpoint = "{0:0.00}";
break;
}

Add(PeriodType.Tick,50);

CalculateOnBarClose = true;
Overlay = true;

NinjaTrader_Austin
12-21-2009, 11:28 AM
Bernard, I know it will be a tedious process, but if you could provide a stripped-down sample of code that demonstrates the freezing, we'd love to take a look at it.

To do so, you could simply place different Print() statements throughout the code to help pinpoint where the code stops and the freezing starts.

blarouche
12-21-2009, 12:02 PM
Good idea

I'll do that and come back to you