thanks in advance!
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
Draw Rectangle Open[2][1] Close[2][1]
Collapse
X
-
Draw Rectangle Open[2][1] Close[2][1]
Hey guys, this is the thing, right now im just Ploting moving Averages at the Closes[1] & Opens[1] but its kind confusing visually, i would like to have a rectangle drawn for each closed bar of a bigger TimeFrame, it cant be that hard, how can i do it with DrawRectangle?
thanks in advance! -
Hi Patrick, thanks for your previous help, i've played with the snippet a bit , see if i can make it plot properly but failed :/ how can i make the rectangles extend all the way to the beginning of the next bar ?
One more non-related question , why do i get pop-ups saying "Unable to write cache data" when i try to create / reload a chart? thank you in advance
if(BarsInProgress == 1)
{
DrawRectangle( "Tag"+CurrentBars[1] , true, 0, Opens[1][0] , 3 , Closes[1][0] ,Color.Blue, Color.Blue, 2);
}Last edited by kabott; 09-10-2014, 09:35 PM.
Comment
-
Hello kabott,
Thank you for your response.
Please try the following:
Code:DrawRectangle( "Tag"+CurrentBars[1] , true, 3, Opens[1][0] , -1 , Closes[1][0] ,Color.Blue, Color.Blue, 2);
Comment
-
Hi Patrick, i already sent you the trace files to the address you requested,
Ive tried the snippet you gaved me but the rectangles dont extend all the way to the begging of the next bar open
i think there is something missing, like, shouldn't somehow tell the drawRectangle how many bars extend to the right ? i mean something of a bar counter, counting the bars[0] generated since the last bar[1] close and then when this one closes use that count to generate the rectangle?
Comment
-
Hello kabott,
Thank you for your response.
0 would be the current bar as far as bars ago. So you would want to set the end bars ago to 0 and then set your CalculatOnBarClose to False. That should plot the rectangle to the current bar's open.
If not, please provide a screenshot of the rectangle manually drawn on the chart as you would like to see it and provide me the code you are using.
Comment
-
Hi Patrick, sorry to be such a pain, i though it was easyer, this is how it should plot the rectangles, basically i wanna see whats going on inside the range of a higher time-frame Renko
current ploting
How it should be
Thanks againg
edit: sorry, i made a mistake, the rectangle at the top should be blue
Comment
-
Patrick, here is a better example of what im looking to create
so, with this one should be able to "see" inside a higher time frame range, later i can add some alerts using the original moving averages etc, but this way looks so much comprehensible to me, one look and i can understand whats going on at a higher time frame
thanks again for your help Patrick
Comment
-
Kabott,
Thank you for your file.
The reason you are seeing these results is because you can only draw to the primary time frame/data series.
This also includes the bars for the primary bar and not the ones from the secondary calculation.
If you want to get the bar count from the day to translate to the primary, you will need to calculate when the bars will begin and end in the secondary data series and then translate that to the primary for the correct number of bars.Cal H.NinjaTrader Customer Service
Comment
-
Kabott,
I don't have any examples available.
You may want to look into using GetBar() and Time data value.
http://www.ninjatrader.com/support/helpGuides/nt7/index.html?time.htm
http://www.ninjatrader.com/support/h...tml?getbar.htmCal H.NinjaTrader Customer Service
Comment
-
Candlestick pattern indicator
Originally posted by NinjaTrader_Cal View PostKabott,
Thank you for your file.
The reason you are seeing these results is because you can only draw to the primary time frame/data series.
This also includes the bars for the primary bar and not the ones from the secondary calculation.
If you want to get the bar count from the day to translate to the primary, you will need to calculate when the bars will begin and end in the secondary data series and then translate that to the primary for the correct number of bars.
Can you tell me how to set a voice alert on say for example on a bullish engulfing pattern once it had been identified on the chart. The voice alert would let me know it showed up on the chart.
Comment
-
Hello,
Thank you for the question.
For adding alerts or other sounds to NinjaScript you have a few options on what you can use.
One option is the PlaySound() method, this simply plays sounds when it is called. If this is used in a loop it would play every time its called so take note of that. Here is the documentation on it: http://www.ninjatrader.com/support/h.../playsound.htm
Additionally you have Alert() method which is a more advanced alert than just a sound, this allows you to play a sound, alert the alerts panel (File - new - alerts) and set a re arm time so it plays again only after X amount of seconds. Here is the documentation: http://www.ninjatrader.com/support/h.../nt7/alert.htm
Once you have made the logic that determines when this will happen you would just need one of the above statements.
For voice alerts, you would need to locate a file with the voice you want, NinjaTrader only supports .wav files so it would need to be an audio clip of a voice to be used.
Please let me know if I may be of additional assistance.JesseNinjaTrader Customer Service
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by techgetgame, Yesterday, 11:42 PM
|
0 responses
9 views
0 likes
|
Last Post
by techgetgame
Yesterday, 11:42 PM
|
||
Started by sephichapdson, Yesterday, 11:36 PM
|
0 responses
2 views
0 likes
|
Last Post Yesterday, 11:36 PM | ||
Started by bortz, 11-06-2023, 08:04 AM
|
47 responses
1,615 views
0 likes
|
Last Post
by aligator
Yesterday, 07:22 PM
|
||
Started by jaybedreamin, Yesterday, 05:56 PM
|
0 responses
10 views
0 likes
|
Last Post
by jaybedreamin
Yesterday, 05:56 PM
|
||
Started by DJ888, 04-16-2024, 06:09 PM
|
6 responses
20 views
0 likes
|
Last Post
by DJ888
Yesterday, 05:12 PM
|
Comment