Help my indicator plot on last bar - futures io
futures io futures trading



Help my indicator plot on last bar


Discussion in TradeStation

Updated
    1. trending_up 2,377 views
    2. thumb_up 8 thanks given
    3. group 3 followers
    1. forum 11 posts
    2. 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)

 
Search this Thread
 

Help my indicator plot on last bar

(login for full post details)
  #1 (permalink)
Philadelphia, PA
 
Experience: Advanced
Platform: Matlab, TradeStation
Trading: Stocks
 
GoldenRatio's Avatar
 
Posts: 206 since Aug 2012
Thanks: 5,000 given, 283 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?



Started this thread Reply With Quote

Journal Challenge February 2021 results (so far):
Competing for $1500 in prizes from Topstep
looks_oneSBtrader82 's Trading Journalby SBtrader82
(166 thanks from 30 posts)
looks_twoJust BEING a Trader: Letting Go!!by iqgod
(113 thanks from 32 posts)
looks_3Wisdom is Emptinessby Mtype
(68 thanks from 25 posts)
looks_4Deetee’s DAX Trading Journal (time based)by Deetee
(31 thanks from 17 posts)
looks_5Journal for peanuts1956by peanuts1956
(23 thanks from 13 posts)
 
 
(login for full post details)
  #2 (permalink)
 
 
Posts: 2,230 since Apr 2013
Thanks: 409 given, 1,470 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 View Post
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?




Follow me on Twitter Reply With Quote
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
 
GoldenRatio's Avatar
 
Posts: 206 since Aug 2012
Thanks: 5,000 given, 283 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;

Started this thread Reply With Quote
 
(login for full post details)
  #4 (permalink)
 
 
Posts: 2,230 since Apr 2013
Thanks: 409 given, 1,470 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

Follow me on Twitter Reply With Quote
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
 
GoldenRatio's Avatar
 
Posts: 206 since Aug 2012
Thanks: 5,000 given, 283 received


ABCTG View Post
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.

Started this thread Reply With Quote
 
(login for full post details)
  #6 (permalink)
 
 
Posts: 2,230 since Apr 2013
Thanks: 409 given, 1,470 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 View Post
Symbol should be blue up arrow. I want it to run on both the daily and weekly chart time frames.


Follow me on Twitter Reply With Quote
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,470 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 ) ;

Follow me on Twitter Reply With Quote
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
 
GoldenRatio's Avatar
 
Posts: 206 since Aug 2012
Thanks: 5,000 given, 283 received

Sorry for being so dense!

Symbol: ALXN
Barinterval: Daily

Started this thread Reply With Quote
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
 
GoldenRatio's Avatar
 
Posts: 206 since Aug 2012
Thanks: 5,000 given, 283 received


ABCTG View Post
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?

Started this thread Reply With Quote
 
(login for full post details)
  #10 (permalink)
 
 
Posts: 2,230 since Apr 2013
Thanks: 409 given, 1,470 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 View Post
Sorry for being so dense!

Symbol: ALXN
Barinterval: Daily


Follow me on Twitter Reply With Quote
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
 
GoldenRatio's Avatar
 
Posts: 206 since Aug 2012
Thanks: 5,000 given, 283 received


ABCTG View Post
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!

Started this thread Reply With Quote
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,470 received

GoldenRatio,

you are welcome, I am glad that it helped. Keep up the good programming work.

Regards,
ABCTG

Follow me on Twitter Reply With Quote
The following user says Thank You to ABCTG for this post:


futures io Trading Community Platforms and Indicators TradeStation > Help my indicator plot on last bar


Last Updated on October 26, 2014


Upcoming Webinars and Events
 

NinjaTrader Indicator Challenge!

Ongoing
 

Journal Challenge w/$1500 prizes from Topstep!

February
 

Battlestations! Show us your trading desk - $1,500 in prizes!

March
     



Copyright © 2021 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, +507 833-9432, info@futures.io
All information is for educational use only and is not investment advice.
There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
no new posts