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 rbeckmann05, Yesterday, 06:48 PM
|
1 response
12 views
0 likes
|
Last Post
by bltdavid
Today, 05:43 AM
|
||
Started by llanqui, Today, 03:53 AM
|
0 responses
6 views
0 likes
|
Last Post
by llanqui
Today, 03:53 AM
|
||
Started by burtoninlondon, Today, 12:38 AM
|
0 responses
10 views
0 likes
|
Last Post Today, 12:38 AM | ||
Started by AaronKoRn, Yesterday, 09:49 PM
|
0 responses
15 views
0 likes
|
Last Post
by AaronKoRn
Yesterday, 09:49 PM
|
||
Started by carnitron, Yesterday, 08:42 PM
|
0 responses
11 views
0 likes
|
Last Post
by carnitron
Yesterday, 08:42 PM
|
Comment