Trading Articles
Article Categories
Article Tools
Help my indicator plot on last bar
Updated October 26, 2014
trending_up
2,384 views
thumb_up
8 thanks given
group
3 followers
forum
11 posts
attach_file
3 attachments
Welcome to futures io: the largest futures trading community on the planet, with well over 125,000 members
Genuine reviews from real traders, not fake reviews from stealth vendors
Quality education from leading professional traders
We are a friendly, helpful, and positive community
We do not tolerate rude behavior, trolling, or vendors advertising in posts
We are here to help, just let us know what you need
You'll need to
register in order to view the content of the threads and start contributing to our community.
It's free and simple.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
Help my indicator plot on last bar
(login for full post details)
#1 (permalink )
Philadelphia, PA
Experience: Advanced
Platform: Matlab, TradeStation
Trading: Stocks
Posts: 207 since Aug 2012
Thanks: 5,004 given,
290
received
Can somebody please tell me why my indicator is not plotting on the last bar?
For example, I would have expected a blue arrow to be plotted over the last bar as all the conditions are met?
I checked the scale range and it is set to "Expand Range to include Analysis Techniques" so it shouldn't be off the screen. Any ideas?
Can you help answer these questions from other members on futures io?
Best Threads (Most Thanked) in the last 7 days on futures io
(login for full post details)
#2 (permalink )
Posts: 2,230 since Apr 2013
Thanks: 409 given,
1,471
received
GoldenRatio,
can you post the code in a code box? Also what chart symbol and chart setting did you use, so someone can reproduce it?
Is update intrabar checked or unchecked for your indicator?
Regards,
ABCTG
GoldenRatio
Can somebody please tell me why my indicator is not plotting on the last bar?
For example, I would have expected a blue arrow to be plotted over the last bar as all the conditions are met?
I checked the
scale range and it is set to "Expand
Range to include Analysis Techniques" so it shouldn't be off the screen. Any ideas?
The following user says Thank You to ABCTG for this post:
(login for full post details)
#3 (permalink )
Philadelphia, PA
Experience: Advanced
Platform: Matlab, TradeStation
Trading: Stocks
Posts: 207 since Aug 2012
Thanks: 5,004 given,
290
received
ABCTG, thanks for offering to help!
Yes update intrabar is checked. I am not sure what you mean when you ask "what chart symbol and chart setting did you use" as I am still earning the language and program.
Code
Using elsystem;
Using elsystem.drawing;
Using elsystem.drawingobjects;
Inputs:
FontName("TradeStation"),
UpChar("Q"),
DnChar("A");
Vars:
Font LabelFont(Null),
TextLabel UpLabel(Null),
TextLabel DnLabel(Null),
SMA10Volume(0),
Stock_Range(0);
SMA10Volume = Average(Volume,10);
Stock_Range = (Close-Low)/(High-Low);
Once Begin
LabelFont = Font.Create(FontName, 12);
End;
if Volume > SMA10Volume AND Close > Close[1] AND Stock_Range >= 0.50 then
Begin
UpLabel = TextLabel.Create(DTPoint.Create(Bardatetime[0], High+3), UpChar);
UpLabel.Font = LabelFont;
UpLabel.HStyle = HorizontalStyle.center;
UpLabel.VStyle = VerticalStyle.center;
UpLabel.Color = color.Blue;
DrawingObjects.Add(UpLabel);
End;
(login for full post details)
#4 (permalink )
Posts: 2,230 since Apr 2013
Thanks: 409 given,
1,471
received
I meant the symbol and bar interval settings that you used for the chart where your arrow should have appeared on the last bar.
It seems to be a daily chart, but what is the symbol?
Regards,
ABCTG
The following user says Thank You to ABCTG for this post:
(login for full post details)
#5 (permalink )
Philadelphia, PA
Experience: Advanced
Platform: Matlab, TradeStation
Trading: Stocks
Posts: 207 since Aug 2012
Thanks: 5,004 given,
290
received
ABCTG
I meant the symbol and bar interval settings that you used for the chart where your arrow should have appeared on the last bar.
It seems to be a daily chart, but what is the symbol?
Regards,
ABCTG
Symbol should be blue up arrow. I want it to run on both the daily and weekly chart time frames.
(login for full post details)
#6 (permalink )
Posts: 2,230 since Apr 2013
Thanks: 409 given,
1,471
received
The chart symbol. If I want to reproduce your chart picture you posted, what do I have to set up?
Chart symbol - for example SPY, MSFT, GOOG etc.
Barinterval - for example Daily, 2 Years back.
GoldenRatio
Symbol should be blue up arrow. I want it to run on both the daily and weekly chart time frames.
The following user says Thank You to ABCTG for this post:
(login for full post details)
#7 (permalink )
Posts: 2,230 since Apr 2013
Thanks: 409 given,
1,471
received
A good way to find out what is going within your code is by adding plots or print statements.
If you add this to the end of your code, it will add a plot to the chart showing +1 when your conditions are met and 0, when they are not. So you can easily see if the arrow is maybe just out of sight.
The print statement will output the values to the print log, so you can exactly see what is going on and why an arrow is missing.
Regards,
ABCTG
Code
if Volume > SMA10Volume AND Close > Close[1] AND Stock_Range >= 0.50 then
Plot1( +1 )
else
Plot1( 0 );
Print( ElDateToString( Date ), "; Volume: ", Volume, "; SMA10Volume: ", SMA10Volume, "; Close: ", Close, "; Close[1]: ", Close, "; Stock_Range: ", Stock_Range ) ;
The following user says Thank You to ABCTG for this post:
(login for full post details)
#8 (permalink )
Philadelphia, PA
Experience: Advanced
Platform: Matlab, TradeStation
Trading: Stocks
Posts: 207 since Aug 2012
Thanks: 5,004 given,
290
received
Sorry for being so dense!
Symbol: ALXN
Barinterval: Daily
The following user says Thank You to GoldenRatio for this post:
(login for full post details)
#9 (permalink )
Philadelphia, PA
Experience: Advanced
Platform: Matlab, TradeStation
Trading: Stocks
Posts: 207 since Aug 2012
Thanks: 5,004 given,
290
received
ABCTG
A good way to find out what is going within your code is by adding plots or print statements.
If you add this to the end of your code, it will add a plot to the chart showing +1 when your conditions are met and 0, when they are not. So you can easily see if the arrow is maybe just out of sight.
The print statement will output the values to the print log, so you can exactly see what is going on and why an arrow is missing.
Regards,
ABCTG
Code
if Volume > SMA10Volume AND Close > Close[1] AND Stock_Range >= 0.50 then
Plot1( +1 )
else
Plot1( 0 );
Print( ElDateToString( Date ), "; Volume: ", Volume, "; SMA10Volume: ", SMA10Volume, "; Close: ", Close, "; Close[1]: ", Close, "; Stock_Range: ", Stock_Range ) ;
I added the statement and it does show a value of 1 on the last bar.
If the arrow is out of sight, how do I set the chart to resize to automatically show indicator?
(login for full post details)
#10 (permalink )
Posts: 2,230 since Apr 2013
Thanks: 409 given,
1,471
received
GoldenRatio,
no worries. Your code is correctly working, good job. The arrow is just outside the visual area. You can check this by setting the symbol to center last price.
Although this is not a good setting for charting. I would suggest trying to set the subgraph margins Lower and Upper to maybe 10%.
Regards,
ABCTG
GoldenRatio
Sorry for being so dense!
Symbol: ALXN
Barinterval: Daily
The following user says Thank You to ABCTG for this post:
(login for full post details)
#11 (permalink )
Philadelphia, PA
Experience: Advanced
Platform: Matlab, TradeStation
Trading: Stocks
Posts: 207 since Aug 2012
Thanks: 5,004 given,
290
received
ABCTG
GoldenRatio,
no worries. Your code is correctly working, good job. The arrow is just outside the visual area. You can check this by setting the symbol to center last price.
Although this is not a good setting for charting. I would suggest trying to set the subgraph margins Lower and Upper to maybe 10%.
Regards,
ABCTG
Thank you, setting subgraph margins Lower and Upper to 10% worked!
Appreciate your help ABCTG!
The following user says Thank You to GoldenRatio for this post:
(login for full post details)
#12 (permalink )
Posts: 2,230 since Apr 2013
Thanks: 409 given,
1,471
received
GoldenRatio,
you are welcome, I am glad that it helped. Keep up the good programming work.
Regards,
ABCTG
The following user says Thank You to ABCTG for this post:
Last Updated on October 26, 2014
Right now
Ongoing
Right now
March
Register to Attend
Elite only
Coming soon
April