Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Script Issues
Collapse
X
-
Script Issues
I have a script that is supposed to only buy prior to a certain time in the morning. For some reason it doesn't work. Is there a time setting somewhere on NT that I have to adjust and align as well as for the Interactive Broker platform?Tags: None
-
cdnPATRIOT, NT would always use your local set PC time / zone as reference. Which NT7 and TWS version are you exactly working with here? Which time filter condition is used in the script? If you debug it, by for example changing bar colors when it would evaluate to true, does the outcome align with your expectations?BertrandNinjaTrader Customer Service
-
I'm working with TWS 938.1e and NT 7.0.100.14.
Not sure what time filter condition is used in the script but here is the script.Attached Files
Comment
-
Originally posted by cdnPATRIOT View PostI'm working with TWS 938.1e and NT 7.0.100.14.
Not sure what time filter condition is used in the script but here is the script.
Code:private int iTradeByTimeLong = 1100; && Time[0].Hour * 100 + Time[0].Minute <= this.iTradeByTimeLong private int iTradeByTimeShort = 1000; && Time[0].Hour * 100 + Time[0].Minute <= this.iTradeByTimeShort
Comment
-
cdnPATRIOT, thanks. The timeFilter looks ok to me. However you would need to keep in mind ExitOnClose is generally false, so perhaps there's a situation where other day exits do not trigger as expected and thus the script holds overnight and exits outside the time filter when you don't expext? As the time filter would only apply to the entries.
R14 or higher for TWS 938 should be fine, we generally would recommend to be on latest NT though, which currently is R22.BertrandNinjaTrader Customer Service
Comment
-
Thanks Bertrand and Sledge. The cut off time should be 11 am for longs and 10 am for short. But it's adjustable in the strategy settings screen that I right click on after I open a chart.
Exit on close should trigger when a certain defined volume level has not been reached. For some reason this hasn't worked as intended either.
Back to this case though both buys occurred at about 12:20 pm well after the cutoff so it may be where there was a short trade from another day still in the system and the system covered the short. Otherwise no buys should occur what so ever after 11 am.
Thanks for verifying that the time filter only applies to entries.
I'm going to upgrade it to the next version of NT as well.
Comment
-
Hello cdnPATRIOT,
Are you changing the iTradeByTimeLong or iTradeByTimeShort inside of the Parameters section of your Strategy?
Also, are you checking the time that the strategy has entered inside of the NinjaTrader chart or you looking at something else like the TWS screen?JCNinjaTrader Customer Service
Comment
-
Hi JC
"Are you changing the iTradeByTimeLong or iTradeByTimeShort inside of the Parameters section of your Strategy?"
I'm leaving it as 11 pm for long and 10 am to go short. However, yesterday it happened again. The volume indicator and technical indicators were met at about 9:55 am but it went short at 12:34 pm.
"Also, are you checking the time that the strategy has entered inside of the NinjaTrader chart or you looking at something else like the TWS screen? "
Yes I'm looking at both the chart and the TWS screen. Still stuck on this one.
I've made sure that I have the most up to date copy of NT.
Comment
-
JCNinjaTrader Customer Service
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by PaulMohn, Today, 05:00 AM
|
0 responses
8 views
0 likes
|
Last Post
by PaulMohn
Today, 05:00 AM
|
||
Started by ZenCortexAuCost, Today, 04:24 AM
|
0 responses
6 views
0 likes
|
Last Post Today, 04:24 AM | ||
Started by ZenCortexAuCost, Today, 04:22 AM
|
0 responses
3 views
0 likes
|
Last Post Today, 04:22 AM | ||
Started by SantoshXX, Today, 03:09 AM
|
0 responses
16 views
0 likes
|
Last Post
by SantoshXX
Today, 03:09 AM
|
||
Started by DanielTynera, Today, 01:14 AM
|
0 responses
5 views
0 likes
|
Last Post
by DanielTynera
Today, 01:14 AM
|
Comment