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 Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
576 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
334 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
101 views
0 likes
|
Last Post
by Mindset
02-09-2026, 11:44 AM
|
||
|
Started by Geovanny Suaza, 02-02-2026, 12:30 PM
|
0 responses
553 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
551 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment