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
how to enter open[0]+10 in a variable?
Collapse
X
-
how to enter open[0]+10 in a variable?
Hello. My programming knowledge is small. I would appreciate some guidance. I have a button that launches an order at Open[0]+10 ticks. When a new bar is created the order is moved. I know that for it not to move I should include the Open[0]+10 ticks in a variable and place that variable in EnterLongStopLimit((Open[0] + (18 * TickSize)) , (Open[0] + (18 * TickSize )) , "l"); but I am not able to include the Open[0]+10 ticks in a variable. Could you help me a little? thank you.Tags: None
-
Do you mean you want to store the open only at the open of the day, or at the open of each bar?
If you mean the open of each bar, it would be like:
double MyOpenValue = Open[0];
EnterLongStopLimit(MyOpenValue + 10 * TickSize, "EntryOrderNameHere");
If you mean the open of each day, and it's a 24-hour chart, you would need to check for the first bar that is after the open and only store it on that bar.
- Likes 1
-
Hello julifro,
To make the order not move you need to store the price you want to a variable at a specific point, for example when you first enter. That variable can be used for the orders price so when you re submit it the same price is being used each time you call the order method again. It would only move if you later update that variables price before the order fills.JesseNinjaTrader Customer Service
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by AaronKoRn, Today, 09:49 PM
|
0 responses
6 views
0 likes
|
Last Post
by AaronKoRn
Today, 09:49 PM
|
||
Started by carnitron, Today, 08:42 PM
|
0 responses
8 views
0 likes
|
Last Post
by carnitron
Today, 08:42 PM
|
||
Started by strategist007, Today, 07:51 PM
|
0 responses
9 views
0 likes
|
Last Post Today, 07:51 PM | ||
Started by StockTrader88, 03-06-2021, 08:58 AM
|
44 responses
3,975 views
3 likes
|
Last Post
by jhudas88
Today, 06:59 PM
|
||
Started by rbeckmann05, Today, 06:48 PM
|
0 responses
9 views
0 likes
|
Last Post
by rbeckmann05
Today, 06:48 PM
|
Comment