I want to create a bar. It has no tick time but operations. seeing the timesale I see the volumes of every single transaction. I want the transaction bar. how you do it?
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
bartype
Collapse
X
-
Hello bebbus, thanks for your note.
The T&S window gets this info from the OnMarketData method. Overriding this will provide an order type (buy or sell), the quantity, and the volume for every tick of the market.
Please let us know if we can assist any further.
Chris L.NinjaTrader Customer Service
-
Hello bebbus,
Thanks for your reply.
If you want to create a bar type yourself, please see the help guide here: https://ninjatrader.com/support/help...?bars_type.htm You may want to create the bars type using the Ninjascript wizard to ensure you have the structure needed (unless you want to copy and modify an existing bar type), here is a link to the wizard help guide: https://ninjatrader.com/support/help...?ns_wizard.htm
Your NinjaTrader8 comes with a number of bars types and their source code is available for you if you want to see what the structure is like through the Ninjascript editor (BarTypes folder).
Alternatively, if you would rather have this created for you, we can provide references to 3rd party providers of that service.Paul H.NinjaTrader Customer Service
Comment
-
Hello meweini,
Welcome to the forums.
Could you let us know what difficulties you are having when creating your custom BarsType so we can provide further insight? The information Paul has provided in post 4 will provide direction for creating a new BarsType and how you can reference the existing BarsTypes to help you in the development process.
We look forward to assisting.JimNinjaTrader Customer Service
Comment
-
Hello,
Interesting conversation. What is a newbar?
I am looking to create a simulation from calculations i made.
DoesAddBar(bars,open,high,low,close,time,(long)Math.Min(volumeTmp,bars.BarsPeriod.Value));ChartBars.ToIndex?
would allow me to create new bars beyong the scope of
Lets say i have a for loop that goes from ChartBars.FromIndex toChartBars.ToIndex and there is 100 bars but i want to predict the future and need to add 50 bars in the for loop with each containing close and volume, can AddBar do that or its completly unrelated?
Ty
Comment
-
Hello frankduc,
AddBar would not be used in the use case you described, this cannot be used from within an indicator or other script. AddBar is specific to a BarsType and would be unrelated to your description. If you are making a BarsType specifically and your calculation is based solely on the market data, you could execute your plan from there to generate bars as needed. You cannot use indicators from a BarsType so your calculation would need to completely reside in the BarsType if that is what your goal is.
please let me know if I may be of further assistance.JesseNinjaTrader Customer Service
Comment
-
Hello,
That would be more like a simulation. Lets say i have a for loop: with 100 bars
Code:for (int barIndex = ChartBars.FromIndex; barIndex <= ChartBars.ToIndex; barIndex++)
Lets say i want to add 10 bars (those bars dont exist in the chart i create them with my own values i have calculated) to make it 110 bars.
If i do
Code:[LEFT][COLOR=#4D4D4D][FONT=Helvetica]for ([/FONT][/COLOR][/LEFT][LEFT][COLOR=#4D4D4D][FONT=Helvetica][SIZE=13px]int barIndex = ChartBars.FromIndex; barIndex <= ChartBars.ToIndex + 10; barIndex++)[/SIZE][/FONT][/COLOR][/LEFT]
How could i include close and volume for each 10 bars i am adding?
TY.
Comment
-
Hello frankduc,
My prior reply still applies to your new statement.
Before we continue with any further questions, what is your specific goal and what type of script are you trying to execute that goal from?
Are you specifically trying to build a BarsType?
AddBar only relates to a BarsType, if you are not making a BarsType your question is not relevant to this post. The loop you have displayed is used for OnRender to gather the currently visible bars, this has no relevance in a BarsType.
If you want further information about BarsTypes and how they work, please explore one of the existing BarsTypes in the NinjaScript editor.
Please let me know if I may be of further assistance.JesseNinjaTrader Customer Service
Comment
-
Jesse,
Like you said i dont think bartype is relevant to my goal. I am still trying to figure out what i want to do and how to do it. So i gather info.
Regarding bartype from what i understand it allow a user to create a certain type of bars like a minute bar, volume bar, etc.
I dont have access to thick data so i cant get overnight volume chart. Would it be possible to use bartype to create a bar that would convert minute volume into bar volume equal to the volume of a minute?
Lets say there is a minute bar at 5 am with a 1000 volumes. Could it be converted into 5 bars candle of 200 contracts?
ty
Comment
-
Hello frankduc,
I dont have access to thick data so i cant get overnight volume chart. Would it be possible to use bartype to create a bar that would convert minute volume into bar volume equal to the volume of a minute?
Lets say there is a minute bar at 5 am with a 1000 volumes. Could it be converted into 5 bars candle of 200 contracts?- In the NS editor right click on BarsType and click new
- Click Generate
- Find the line which looks like this and copy it: BarsPeriod = new BarsPeriod { BarsPeriodType = (BarsPeriodType) 15, Value = 1 };
- Close the file without saving
- Open the Volume BarsType
- Right click -Save As and give it a name
- Paste over the existing BarsPeriod = line with what you copied, also replace the Name with a string instead of the Custom.Resource line.
Code:Name = "TestVolume"; BarsPeriod = new BarsPeriod { BarsPeriodType = (BarsPeriodType) 15, Value = 1 };
Please let me know if I may be of additional assistance.
JesseNinjaTrader Customer Service
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by DJ888, 04-16-2024, 06:09 PM
|
4 responses
12 views
0 likes
|
Last Post
by DJ888
Today, 04:28 PM
|
||
Started by terofs, Today, 04:18 PM
|
0 responses
7 views
0 likes
|
Last Post
by terofs
Today, 04:18 PM
|
||
Started by nandhumca, Today, 03:41 PM
|
0 responses
6 views
0 likes
|
Last Post
by nandhumca
Today, 03:41 PM
|
||
Started by The_Sec, Today, 03:37 PM
|
0 responses
3 views
0 likes
|
Last Post
by The_Sec
Today, 03:37 PM
|
||
Started by GwFutures1988, Today, 02:48 PM
|
1 response
9 views
0 likes
|
Last Post Today, 03:09 PM |
Comment