I've been playing around with the built-in indicators, but I figured I should use ninjascript to get exactly what I want.
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
Writing code for stop orders and GTC
Collapse
X
-
Writing code for stop orders and GTC
What is the best way to type up a script that sets up the BTO at the high of previous day (high[1]) and the STC at the low of the previous day (low[1]) with the type set at "GTC".
I've been playing around with the built-in indicators, but I figured I should use ninjascript to get exactly what I want.Tags: None
-
https://ninjatraderecosystem.com/use..._search=profit
Based on PriorDayOHLC indicator. PriorWeekOHLC will draw lines on your chart: Open, Close, High, Low for the given previous week. You can select on which day the indicator should start calculating from. An example to access the week open value: double priorWeekOpenPrice = PriorWeekOHLC(true,true,true,true,DayOfWeek.Monday ).PriorWeekOpen[0]; Enjoy
-
Hello pssumking93,
Are you looking for a specific indicator with plots that have the names BTO and STC?
I am personally am not familiar with these.
This thread will remain open for any community members that may know of indicators with these plot names.
Below I am providing a link to a forum post with helpful information about getting started with NinjaScript.
You can also contact a professional NinjaScript Consultant who would be eager to create or modify this script at your request or assist you with your script. The NinjaTrader Ecosystem has affiliate contacts who provide educational as well as consulting services. Please let me know if you would like our business development follow up with you with a list of affiliate consultants who would be happy to create this script or any others at your request.Chelsea B.NinjaTrader Customer Service
Comment
-
I'm not looking for specific indicators that have the names BTO and STC.
I just want to be able to write for a script that incorporates the "buy to open" based off the high of the previous day and the "sell to close" at the low of the previous day.
Comment
-
Hello,
I am understanding you are asking how to use a Time-In-Force code (TIF).
A NinjaScript Strategy can have all orders with Day, Gtc, Gtd.
https://ninjatrader.com/support/help...imeinforce.htm
Submitting orders through the account through addon tools allows for a few more TIF codes such as OPG (on the open).
https://ninjatrader.com/support/help...reateorder.htm
I am happy to submit a feature request to use other specific codes if you would like.
Below I am adding the definitions used by NinjaTrader.
- DAY (Good for the Day) – good until the end of the regular session.
- GTC (Good Till Canceled) – good until you cancel the order, stays active a maximum of 60 days.
- GTD (Good Till Date) – good until a date you specify.
- EXT (Good for the Day plus Extended Hours) – this order will be good for all the sessions for one day, including the pre-market session, the regular session and the following extended hours session. If the order is submitted during any of these sessions, it will carry through the other sessions for the current day.
- OPG (On the Open) – order is submitted to fill on the opening price of the market (opening print) or as close as possible to the opening price.
- CLO (On the Close) - order is submitted to fill on the closing price of the market or as close as possible to the closing price (closing print).
- IOC (Immediate or Cancel) – order must fill immediately or it is canceled (or the portion unfilled cancelled).
- FOC (Fill or Kill) – order must be immediately filled in its entirety or it is canceled. This is like a combination of Immediate or Cancel (IOC) with All or None (AON) special handling.Last edited by NinjaTrader_ChelseaB; 12-01-2019, 08:02 PM.Chelsea B.NinjaTrader Customer Service
Comment
-
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by eduardodipp7, Today, 10:29 AM
|
0 responses
1 view
0 likes
|
Last Post
by eduardodipp7
Today, 10:29 AM
|
||
Started by AgriTrdr, 07-16-2023, 12:54 PM
|
39 responses
272 views
0 likes
|
Last Post
by f.saeidi
Today, 10:23 AM
|
||
Started by ninza33, Today, 09:10 AM
|
1 response
10 views
0 likes
|
Last Post Today, 09:46 AM | ||
Started by goodknight777, Today, 08:43 AM
|
1 response
6 views
0 likes
|
Last Post Today, 09:25 AM | ||
Started by kramnor2001, Yesterday, 02:30 PM
|
3 responses
21 views
0 likes
|
Last Post
by kramnor2001
Today, 09:20 AM
|
Comment