buy this bar on close;
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
why didn't this code work
Collapse
X
-
Tags: None
-
thank you for your reply Josh, however I'm confused as to how I would enter an order then
if this is correct:
if NTMarketPosition("Uxxxxx") = 0 then begin
//buy this bar on close;
then would this work...
if NTMarketPosition("Uxxxxx") = 0 then
begin
if condition1 then
buy this bar on close;
end
2) Also, using the following functions that are in the NT DLL, will you get tradestation to successfully backtest it. Say that the following code
if condition1 then
buy this bar on close
if barssinceentry = 5 then
sell this bar on close
* say that the above code produces 50 trades on a tradestation backtest
now
if NTMarketPosition("Uxxxxx") = 0 then
begin
if condition1 then
buy this bar on close;
end
if NTMarketPosition("Uxxxxx") > 0 then
begin
if barssinceentry = 5 then
sell this bar on close;
end
?? would you get the 50 trades to show up on the tradestation backtest?
Comment
-
1)is not really code. To place orders you need to program the logic to send the order at the bar close and then you would use NTBuyMarket or any of the other functions listed here: http://www.ninjatrader-support.com/H...html?Functions.Code:buy this bar on close
You would need two "end" to close both if statements.Code:if NTMarketPosition("Uxxxxx") = 0 then begin if condition1 then buy this bar on close; end
2) Unfortunately I cannot provide guidance on TradeStation's backtesting, but I would assume the codes will work theoretically. Perhaps this sample code (http://www.ninjatrader-support.com/H...SanpleStrategy) will help you in programming ELDs that use NinjaTrader in TradeStation.Josh P.NinjaTrader Customer Service
Comment
-
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by argusthome, 03-08-2026, 10:06 AM
|
0 responses
68 views
0 likes
|
Last Post
by argusthome
03-08-2026, 10:06 AM
|
||
|
Started by NabilKhattabi, 03-06-2026, 11:18 AM
|
0 responses
41 views
0 likes
|
Last Post
|
||
|
Started by Deep42, 03-06-2026, 12:28 AM
|
0 responses
24 views
0 likes
|
Last Post
by Deep42
03-06-2026, 12:28 AM
|
||
|
Started by TheRealMorford, 03-05-2026, 06:15 PM
|
0 responses
27 views
0 likes
|
Last Post
|
||
|
Started by Mindset, 02-28-2026, 06:16 AM
|
0 responses
53 views
0 likes
|
Last Post
by Mindset
02-28-2026, 06:16 AM
|

Comment