Be sure you are using CalculateOnBarClose = false when in real-time.
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
contruction of his own shooting star
Collapse
X
-
Open[0] is the price of the current bar. You cannot set a price on the next bar because you do not know what the next bar will be. Only when that next bar has been started will you know the price and then you can submit at Open[0] for that bar.
Be sure you are using CalculateOnBarClose = false when in real-time.Josh P.NinjaTrader Customer Service
-
oki a sell limit order for example close of the bar[0]
but i put a stop order and it is ignored... i made it exactly like on the guide...
wacth my script : what's wrong ?
{
EnterShortLimit(1, Close[0], "");
stopPrice = (High[0]+3*TickSize);
}
//Exits position
ExitShortStop(stopPrice);
}
Comment
-
to be honest the guide is not really clear... I try to devellop a really simply script :
i defined my shooting star, if there is a shooting star you sell limit at close of the shooting star, you put a stop 3 tick above the shooting star and you take profit at a risk reward of 2 (entry level - (stop-entry level)*2)... really simply indeed... here my script develop with the guide... what's wrong on my script ?
Comment
-
followed by :
if (MyShooting)
{
HS=High[0];
{
BackColor = Color.Pink;
EnterShortLimit(1, Close[0], "");
}
}
else
{
//the stop is 3 ticks above my shooting star
stopPrice = (HS + 3*TickSize);
if (ExitShortStop(stopPrice));
{
EntryLevel=EnterShortLimit;
//exit position at a risk reward of 2
ExitShortLimit(EntryLevel-(stopPrice-Entry)*2);
}
}
}
Comment
-
Thomas79,
if (ExitShortStop(stopPrice));
{
EntryLevel=EnterShortLimit;
//exit position at a risk reward of 2
ExitShortLimit(EntryLevel-(stopPrice-Entry)*2);
}
That part does not make sense. ExitShortStop() is not something you would run an if-statement on. It places orders.
When you use limit/stop orders you need to keep them alive. Please read this article: http://www.ninjatrader-support.com/H...tml?Overview36Josh P.NinjaTrader Customer Service
Comment
-
oki i read the article... the best this for me is to set a stop loss and a set profit target... it is write that it is better to write the script in Initialize... this is what i did and it doesn't work :
protectedoverridevoid Initialize()
{
CalculateOnBarClose = true;
//Submits a stop loss 3 ticks above my shooting define bool MyShooting
SetStopLoss(High[0] + 3* TickSize);
}
we are ok than the 'High[0] is the top of the bar where i have my signal... so my shooting star ?
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
574 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
332 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