Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Is This Possible?
Collapse
X
-
Hi Ray/Josh
Thanks for your help, but I am still having some issues with this strategy. I am using the one as posted in Josh's reply and initially it seemed to work but that I cannot seem to get it to run correct now.
The strategy does not open a position. It is as if it runs through the code first and the command simEntry=true under condition set 2 is executed first ...??
If I remove that line, the strategy does open a position, but then of course it just loops into buy/sell continuously. If I put that ine back in under condition set 2, it never opens a position...
Any ideas what would cause this behaviour?
Comment
-
Are you talking about real-time or backtesting?
The check against Historical means it will only show up on backtests. Please use Print functions throughout the code to see what value simEntry is set to at various steps of your logic. This will help you determine why it is opening/not opening your position.Josh P.NinjaTrader Customer Service
Comment
-
I'm guessing you start with a completely blank chart when you start up the Simulated Data Feed then.
The problem is as stated in my previous post. The check against Historical will prevent anything from happening if all the bars on the chart were generated in real-time (sim feed is same as real-time).
Alternatively you could probably try something like
Code:if (CurrentBar == 1) EnterLong(Quantity, "");Josh P.NinjaTrader Customer Service
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by charlesugo_1, 05-26-2026, 05:03 PM
|
0 responses
52 views
0 likes
|
Last Post
by charlesugo_1
05-26-2026, 05:03 PM
|
||
|
Started by DannyP96, 05-18-2026, 02:38 PM
|
1 response
142 views
0 likes
|
Last Post
|
||
|
Started by CarlTrading, 05-11-2026, 05:56 AM
|
0 responses
160 views
0 likes
|
Last Post
by CarlTrading
05-11-2026, 05:56 AM
|
||
|
Started by CarlTrading, 05-10-2026, 08:12 PM
|
0 responses
96 views
0 likes
|
Last Post
by CarlTrading
05-10-2026, 08:12 PM
|
||
|
Started by Hwop38, 05-04-2026, 07:02 PM
|
0 responses
276 views
0 likes
|
Last Post
by Hwop38
05-04-2026, 07:02 PM
|

Comment