PDA

View Full Version : signal passed a high/low on time frame


suedeuno
02-05-2008, 06:22 PM
I wrote code that will enter after a certain time frame and a break of high/low for that timeframe. I only want to make one trade per session. How do I restrict entries per session to no more than one per session?

NinjaTrader_Ray
02-06-2008, 06:45 AM
You would have to create a bool variable that is set to true once you have traded once in a session. Then check for the property FirstBarOfSession to reset this variable to false.

suedeuno
02-06-2008, 10:08 AM
I tried setting a boolean variable to true within the order entry block, however no signals were created when I did that. I would need to reset the variable after each session. How would I do that?

NinjaTrader_Ray
02-06-2008, 10:58 AM
if (FirstBarOfSession)
// Reset variable here

suedeuno
02-06-2008, 03:13 PM
I get "Does not exist in current context." for FirstBarOfSession

NinjaTrader_Ray
02-06-2008, 03:20 PM
My apologies..should be

Bars.FirstBarOfSession