Volume Breakdown / Cumulative Delta Momentum Print indicator - text float problem - futures io
futures io futures trading



Volume Breakdown / Cumulative Delta Momentum Print indicator - text float problem


Discussion in EasyLanguage Programming

Updated
      Top Posters
    1. looks_one Rockford with 5 posts (1 thanks)
    2. looks_two ABCTG with 5 posts (1 thanks)
    3. looks_3 treydog999 with 4 posts (0 thanks)
    4. looks_4 SPMC with 3 posts (2 thanks)
    1. trending_up 8,409 views
    2. thumb_up 4 thanks given
    3. group 4 followers
    1. forum 18 posts
    2. attach_file 2 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
 

Volume Breakdown / Cumulative Delta Momentum Print indicator - text float problem

(login for full post details)
  #1 (permalink)
seoul, Korea
 
Experience: Intermediate
Platform: Multicharts
Broker: CQG, DTN IQfeed
Trading: YM 6E
 
treydog999's Avatar
 
Posts: 896 since Jul 2012
Thanks: 291 given, 1,027 received

Alright so I have created a VB style print that plots in text the cumulative delta momentum (single bar value) on the bottom of the chart. However there is a slight problem, the float only works for bars created real time. other wise it just puts it some displacement from the bar. I want it to float all the time. But none the less this indicator works, its only the aesthetics that are messed up.

Basically you put cumulative delta as data 1/2/3, use data select input to set that. then it will plot at the bottom of your candle chart the delta of that bar.

If someone could tell me how to float historical text objects so they all line up that would be awesome
 
Code
input: Upcolor(rgb(73, 120, 168)), downcolor(rgb(168, 73, 96)),
 NeutralColor(lightgray), TickDisplace( .0005 ), textsize(10), dataselect(3), screenpercent(5);
vars: Cvalue( 0 );

//data and calcs
if dataselect = 1 then
Cvalue = close of data1 - open of data1;

if dataselect = 2 then
Cvalue = close of data2 - open of data2;

if dataselect = 3 then
Cvalue = close of data3 - open of data3;

//Plot text
value1 = text_new(date,time,low - Tickdisplace, numtostr(Cvalue,0));

//stylize text
text_setstyle(value1,2,1);	
text_setsize(value1,textsize);

if cvalue > 0 then
	text_setcolor(value1,upcolor)
else
	text_setcolor(value1,downcolor);
	
value2 = text_Float(value1,0,screenpercent);
note:
if i do last bar and float them with a last bar flag. then it wont display historical values but all of them will be lined up as only bars the platform was here for are printed.

Started this thread Reply With Quote

Can you help answer these questions
from other members on futures io?
Cross border fund flows / fx correlations
Treasury Notes and Bonds
Which kind of Blockvolume is visible? - order processing
Emini and Emicro Index
Reading A set of Trading Signals
EasyLanguage Programming
ZigZag with Depth and Backstep
EasyLanguage Programming
NT8 indicator to simulate a Funding Evaluation where to …
NinjaTrader
 
Best Threads (Most Thanked)
in the last 7 days on futures io
Selling Options on Futures?
107 thanks
Battlestations: Show us your trading desks!
98 thanks
Rank your Futures vs Stocks trading priority
54 thanks
Want your NinjaTrader indicator created, free?
27 thanks
Whats this confusion with margins?
23 thanks
 
(login for full post details)
  #3 (permalink)
 
 
Posts: 2,230 since Apr 2013
Thanks: 409 given, 1,471 received


Hi treydog999,

this will probably take a little bit of programming.

When you use RecalcLastBarAfter, aiHighestDispValue and aiLowestDispValue that are used within the Text_Float function to return the highest and
lowest value for the currently displayed screen, will work on historical bars, too.
This alone doesn't help you of course, as you'd need to access all text IDs on the currently visible chart screen. This probably needs two steps, first store the barnumber for each bar
in a map (or array) using the datetime as map key and store each text ID within a map (or an array, but I'd suggest using a map and the ELCollections.DLL) and using the barnumber as the map key.

In a next step you'd have to get the datetime for the bar most left on the screen using aiLeftDispDateTime and the one on the right using aiRightDispDateTime. Use these two values to retrieve the barnumber
for the most left and most right bars and with these loop through the first map, retrieve each text ID and change the text location to the value of your choice.

Unfortunately I am not sure if there is something simpler, but the above should work. Although it might be too much work just for the aesthetics.

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)
  #4 (permalink)
GER
 
Experience: Advanced
Platform: MC
Trading: ES
 
Posts: 144 since May 2011
Thanks: 11 given, 213 received

The easiest way is it to spilt the text into a realtime part and a history part:

 
Code
input: Upcolor(rgb(73, 120, 168)), downcolor(rgb(168, 73, 96)),
 NeutralColor(lightgray), TickDisplace( .0005 ), textsize(10), dataselect(3), screenpercent(5);
vars: Cvalue( 0 ),RTDELTA_Text(0),HistDelta_Text(0);
{
//data and calcs
if dataselect = 1 then
Cvalue = close of data1 - open of data1;

if dataselect = 2 then
Cvalue = close of data2 - open of data2;

if dataselect = 3 then
Cvalue = close of data3 - open of data3;}

//data and calcs
if dataselect = 1 then
Cvalue = close of data1 - Close[1] of data1;

if dataselect = 2 then
Cvalue = close of data2 - Close[1] of data2;

if dataselect = 3 then
Cvalue = close of data3 - Close[1] of data3;

Once 
begin
		RTDELTA_Text = text_new_S (DATE, Time_S, 0, "") ;
		text_SetStyle 		(RTDELTA_Text, 2, 1) ;
   		 
end;

if barstatus (dataselect ) = 2 then 
begin
	//Plot text
	HistDelta_Text = text_new_S(date,time_S,GetAppInfo( aiLowestDispValue ) + 0.01 * screenpercent*
		 ( GetAppInfo( aiHighestDispValue ) - GetAppInfo( aiLowestDispValue ) )  , numtostr(Cvalue,0));

	//stylize text
	text_setstyle(HistDelta_Text,2,1);	
	text_setsize(HistDelta_Text,textsize);

	if cvalue > 0 then
		text_setcolor(HistDelta_Text,upcolor)
	else if cvalue = 0 then
		text_setcolor(HistDelta_Text,NeutralColor)	
	else 
		text_setcolor(HistDelta_Text,downcolor);

	value1 = GetAppInfo( aiLowestDispValue ) ;
	value2 = GetAppInfo( aiHighestDispValue ) ;
end;

if LastBarOnChart_s then 
begin
	Text_SetString (RTDELTA_Text, numtostr(Cvalue,0));
	if cvalue > 0 then
		text_setcolor(RTDELTA_Text,upcolor)
	else if cvalue = 0 then
		text_setcolor(RTDELTA_Text,NeutralColor)	
	else
		text_setcolor(RTDELTA_Text,downcolor);
	text_SetStyle 		(RTDELTA_Text, 2, 1) ;
	Text_SetLocation_s 	(RTDELTA_Text,date, time_s, GetAppInfo( aiLowestDispValue ) + 0.01 * screenpercent*
		 ( GetAppInfo( aiHighestDispValue ) - GetAppInfo( aiLowestDispValue ) )  );
	text_setsize(RTDELTA_Text,textsize);

end;

if barstatus (dataselect ) = 2 and LastBarOnChart_s then 
begin
	if value1 <> value1 [1] or value2 <> value2 [1] then recalculate;
	
end;

Reply With Quote
The following user says Thank You to SPMC for this post:
 
(login for full post details)
  #5 (permalink)
seoul, Korea
 
Experience: Intermediate
Platform: Multicharts
Broker: CQG, DTN IQfeed
Trading: YM 6E
 
treydog999's Avatar
 
Posts: 896 since Jul 2012
Thanks: 291 given, 1,027 received

@SPMC

Thanks for the indi. however I am having problems with the switch from historical to real time. You can see here that there is a gap of values. They appear on the real time candle but then gap until the historical time series.


Started this thread Reply With Quote
 
(login for full post details)
  #6 (permalink)
GER
 
Experience: Advanced
Platform: MC
Trading: ES
 
Posts: 144 since May 2011
Thanks: 11 given, 213 received

Could you post a complete chart with the data2/3 not hidden? Could it be that you have different settings in data1 and data2 (resolution, sessions, time zone)?

Reply With Quote
 
(login for full post details)
  #7 (permalink)
seoul, Korea
 
Experience: Intermediate
Platform: Multicharts
Broker: CQG, DTN IQfeed
Trading: YM 6E
 
treydog999's Avatar
 
Posts: 896 since Jul 2012
Thanks: 291 given, 1,027 received


SPMC View Post
Could you post a complete chart with the data2/3 not hidden? Could it be that you have different settings in data1 and data2 (resolution, sessions, time zone)?



i double checked all sessions are the same and time zones.

Started this thread Reply With Quote
 
(login for full post details)
  #8 (permalink)
GER
 
Experience: Advanced
Platform: MC
Trading: ES
 
Posts: 144 since May 2011
Thanks: 11 given, 213 received

As i have IQFeed and the code works, it seems that one problem is that at CQG the charts are not fully synchronized. Your upper chart shows a timestamp of 14:04:06.050 and both on the bottom a timestamp
of 14:05:21.093.
So barstatus (1) = 2 could be different to barstatus (3) = 2 .

Try to change the both lines with

if barstatus (dataselect ) = 2 then

to

if barstatus (1 ) = 2 then

Reply With Quote
The following user says Thank You to SPMC for this post:
 
(login for full post details)
  #9 (permalink)
seoul, Korea
 
Experience: Intermediate
Platform: Multicharts
Broker: CQG, DTN IQfeed
Trading: YM 6E
 
treydog999's Avatar
 
Posts: 896 since Jul 2012
Thanks: 291 given, 1,027 received


SPMC View Post
As i have IQFeed and the code works, it seems that one problem is that at CQG the charts are not fully synchronized. Your upper chart shows a timestamp of 14:04:06.050 and both on the bottom a timestamp
of 14:05:21.093.
So barstatus (1) = 2 could be different to barstatus (3) = 2 .

Try to change the both lines with

if barstatus (dataselect ) = 2 then

to

if barstatus (1 ) = 2 then

You're dead on, its because data 1 is M6E so there is a slight mismatch in time stamps.

Started this thread Reply With Quote
 
(login for full post details)
  #10 (permalink)
West Branch, Mi, USA
 
Experience: Intermediate
Platform: Sierra Chart
Broker: TradePro/TransAct
Trading: NQ, CL
 
Posts: 59 since Nov 2012
Thanks: 10 given, 10 received


Hi,
I'm saving this in Tradestation as an .ELD, and when I do I'm getting this error:

Unknown Identifier, Line 27.
RTDELTA_Text = text_new_S (DATE, Time_S, 0, "") ;

(Also, I added the change made by SPMC in his last post).

Should it be FOR VOLUME USE: "Trade Volume" or "Tick Count" ?

I'm not coder. If someone could help me out, I'd really appreciate it.

Thanks,
Rockford

Reply With Quote
 
(login for full post details)
  #11 (permalink)
 
 
Posts: 2,230 since Apr 2013
Thanks: 409 given, 1,471 received

Rockford,

Text_New_s and Time_s are specific to Multicharts and not available in Tradestation. For starters you can simply remove the "_s", this will be accurate on minute charts (and higher). If you use non time based bars you might have to change the code to handle the drawings via Object Oriented EasyLanguage.

Regards,

ABCTG

Follow me on Twitter Reply With Quote
 
(login for full post details)
  #12 (permalink)
West Branch, Mi, USA
 
Experience: Intermediate
Platform: Sierra Chart
Broker: TradePro/TransAct
Trading: NQ, CL
 
Posts: 59 since Nov 2012
Thanks: 10 given, 10 received


ABCTG View Post
Rockford,

Text_New_s and Time_s are specific to Multicharts and not available in Tradestation. For starters you can simply remove the "_s", this will be accurate on minute charts (and higher). If you use non time based bars you might have to change the code to handle the drawings via Object Oriented EasyLanguage.

Regards,

ABCTG

Thank you very much for the help ABCTG.

I'm getting an error on Line 40 now...
text_setsize(HistDelta_Text,textsize);

What do I do with this?

Rockford

Reply With Quote
 
(login for full post details)
  #13 (permalink)
 
 
Posts: 2,230 since Apr 2013
Thanks: 409 given, 1,471 received

Rockford,

it's always helpful to include any error message. In this case it's easier, though: Text_SetSize is not available in legacy EasyLanguage. You'll have to remove the line.

Regards,

ABCTG

Follow me on Twitter Reply With Quote
 
(login for full post details)
  #14 (permalink)
West Branch, Mi, USA
 
Experience: Intermediate
Platform: Sierra Chart
Broker: TradePro/TransAct
Trading: NQ, CL
 
Posts: 59 since Nov 2012
Thanks: 10 given, 10 received

Hi ABCTG, I had to completely remove the end of the code. Will it be ok?

if barstatus (1 ) = 2 then and LastBarOnChart_s then

begin
if value1 <> value1 [1] or value2 <> value2 [1] then recalculate;

end;

Thanks,
Rockford

Reply With Quote
 
(login for full post details)
  #15 (permalink)
 
 
Posts: 2,230 since Apr 2013
Thanks: 409 given, 1,471 received

Rockford,

it should not be a big deal. There is a huge one, though. I just looked at what the code does from the above screenshots and it appears to be using cumulative delta as datastreams. Tradestation doesn't offer these as bars, so you couldn't get the same results simply because you can't feed the code the data it needs. You might want to browse the Tradestation forums as there might be studies that use the data that Tradestation supplies for displaying delta.

Regards,

ABCTG

Follow me on Twitter Reply With Quote
 
(login for full post details)
  #16 (permalink)
West Branch, Mi, USA
 
Experience: Intermediate
Platform: Sierra Chart
Broker: TradePro/TransAct
Trading: NQ, CL
 
Posts: 59 since Nov 2012
Thanks: 10 given, 10 received


ABCTG View Post
Rockford,

it should not be a big deal. There is a huge one, though. I just looked at what the code does from the above screenshots and it appears to be using cumulative delta as datastreams. Tradestation doesn't offer these as bars, so you couldn't get the same results simply because you can't feed the code the data it needs. You might want to browse the Tradestation forums as there might be studies that use the data that Tradestation supplies for displaying delta.

Regards,

ABCTG

Hi ABCTG,

The only one I was able to find here or online was the following one, but I don't know enough about Cumulative Delta to know if I can trust this code. Please let me know if you have an opinion.


https://futures.io/download/tradestation/

Thank you for your time ABCTG,
Rockford

Reply With Quote
 
(login for full post details)
  #17 (permalink)
 
 
Posts: 2,230 since Apr 2013
Thanks: 409 given, 1,471 received

Rockford,

I don't know the code and haven't tested it. So I am afraid, I can't give you any opinions on that.

Regards,

ABCTG


Rockford View Post
Hi ABCTG,

The only one I was able to find here or online was the following one, but I don't know enough about Cumulative Delta to know if I can trust this code. Please let me know if you have an opinion.


https://futures.io/download/tradestation/

Thank you for your time ABCTG,
Rockford


Follow me on Twitter Reply With Quote
 
(login for full post details)
  #18 (permalink)
West Branch, Mi, USA
 
Experience: Intermediate
Platform: Sierra Chart
Broker: TradePro/TransAct
Trading: NQ, CL
 
Posts: 59 since Nov 2012
Thanks: 10 given, 10 received


ABCTG View Post
Rockford,

I don't know the code and haven't tested it. So I am afraid, I can't give you any opinions on that.

Regards,

ABCTG

Thanks for all your help the last couple days ABCTG.

Regards,
Rockford

Reply With Quote
The following user says Thank You to Rockford for this post:
 
(login for full post details)
  #19 (permalink)
New York + US
 
Experience: Intermediate
Platform: MultiCharts
Trading: Indian Stocks
 
Posts: 37 since Aug 2015
Thanks: 10 given, 2 received


treydog999 View Post


i double checked all sessions are the same and time zones.

The third pane is Volume Breakdown?

Reply With Quote


futures io Trading Community Platforms and Indicators EasyLanguage Programming > Volume Breakdown / Cumulative Delta Momentum Print indicator - text float problem


Last Updated on January 21, 2020


Upcoming Webinars and Events
 

NinjaTrader Indicator Challenge!

Ongoing
 

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

March
 

Importance of Finding Your Own Way w/Adam Grimes

Elite only
 

Journal Challenge w/Jigsaw

April
     



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