Be sure you are using CalculateOnBarClose = false when in real-time.
Announcement
Collapse
Looking for a User App or Add-On built by the NinjaTrader community?
Visit NinjaTrader EcoSystem and our free User App Share!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less
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 aussugardefender, Today, 01:07 AM
|
0 responses
3 views
0 likes
|
Last Post Today, 01:07 AM | ||
Started by pvincent, 06-23-2022, 12:53 PM
|
14 responses
238 views
0 likes
|
Last Post
by Nyman
Today, 12:47 AM
|
||
Started by TraderG23, 12-08-2023, 07:56 AM
|
9 responses
384 views
1 like
|
Last Post
by Gavini
Today, 12:29 AM
|
||
Started by oviejo, Today, 12:28 AM
|
0 responses
4 views
0 likes
|
Last Post
by oviejo
Today, 12:28 AM
|
||
Started by pechtri, 06-22-2023, 02:31 AM
|
10 responses
125 views
0 likes
|
Last Post Today, 12:03 AM |
Comment