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 Hwop38, 05-04-2026, 07:02 PM
|
0 responses
161 views
0 likes
|
Last Post
by Hwop38
05-04-2026, 07:02 PM
|
||
|
Started by CaptainJack, 04-24-2026, 11:07 PM
|
0 responses
309 views
0 likes
|
Last Post
by CaptainJack
04-24-2026, 11:07 PM
|
||
|
Started by Mindset, 04-21-2026, 06:46 AM
|
0 responses
245 views
0 likes
|
Last Post
by Mindset
04-21-2026, 06:46 AM
|
||
|
Started by M4ndoo, 04-20-2026, 05:21 PM
|
0 responses
349 views
0 likes
|
Last Post
by M4ndoo
04-20-2026, 05:21 PM
|
||
|
Started by M4ndoo, 04-19-2026, 05:54 PM
|
0 responses
179 views
0 likes
|
Last Post
by M4ndoo
04-19-2026, 05:54 PM
|

Comment