NexusFi: Find Your Edge


Home Menu

 





Global Dictionary sender and receiver


Discussion in EasyLanguage Programming

Updated
      Top Posters
    1. looks_one jsftrader with 4 posts (1 thanks)
    2. looks_two ABCTG with 3 posts (1 thanks)
    3. looks_3 RM99 with 2 posts (0 thanks)
    4. looks_4 bob314159 with 2 posts (0 thanks)
    1. trending_up 10,261 views
    2. thumb_up 6 thanks given
    3. group 6 followers
    1. forum 13 posts
    2. attach_file 3 attachments




 
Search this Thread

Global Dictionary sender and receiver

  #1 (permalink)
 RM99 
Austin, TX
 
Experience: Advanced
Platform: TradeStation
Trading: Futures
Posts: 839 since Mar 2011
Thanks Given: 124
Thanks Received: 704

Can someone walk me through how to setup the send and receive using the globaldictionary. I've pasted the code below for the generic indicator sender and receiver.

Sender:
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

using elsystem.collections ;
inputs:
string GDictName( "MyGD" ),
string KeyToUse( "MyGV" ),
double ValueToSend( 100 ) ;

variables:
GlobalDictionary GDict( NULL ) ;

once
begin
GDict = GlobalDictionary.Create( true, GDictName ) ;

if GDict.Contains( KeyToUse ) then
GDict.Items[ KeyToUse ] = ValueToSend
else
GDict.Add( KeyToUse, ValueToSend ) ;
end ;

Plot1( ValueToSend, "SentValue" ) ;
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

and the receiver:
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
using elsystem ;
using elsystem.collections ;
inputs:
string GDictName( "MyGD" ),
string KeyToRetrieve( "MyGV" ) ;

variables:
GlobalDictionary GDict( NULL ) ;

method void ItemChg( Object Sender, ItemProcessedEventArgs Args )
begin
if Args.Key = KeyToRetrieve then
PlotOutputs() ;
end ;

method void PlotOutputs()
begin
if GDict.Contains( KeyToRetrieve ) then
Plot1( GDict.Items[ KeyToRetrieve ] astype double, "RecValue" ) ;
end ;
once
begin
GDict = GlobalDictionary.Create( true, GDictName ) ;
GDict.ItemChanged += ItemChg ;
end ;

PlotOutputs() ;
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

"A dumb man never learns. A smart man learns from his own failure and success. But a wise man learns from the failure and success of others."
Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Trade idea based off three indicators.
Traders Hideout
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
How to apply profiles
Traders Hideout
What broker to use for trading palladium futures
Commodities
Pivot Indicator like the old SwingTemp by Big Mike
NinjaTrader
 
  #3 (permalink)
 RM99 
Austin, TX
 
Experience: Advanced
Platform: TradeStation
Trading: Futures
Posts: 839 since Mar 2011
Thanks Given: 124
Thanks Received: 704


Sorry, should have been posted in TradeStation. Not sure if MC uses globaldictionary or not. Big Mike, please move. Thanks.

"A dumb man never learns. A smart man learns from his own failure and success. But a wise man learns from the failure and success of others."
Started this thread Reply With Quote
  #4 (permalink)
fbraden
Houston, TX
 
Posts: 1 since Apr 2011
Thanks Given: 0
Thanks Received: 1

Demonstrates in two very simple to use and modify templates, how to send and receive global data in realtime. You should modify the Global Variables and Plot Method to meet your needs.

Read the fully commented details in the source code for usage instructions.

Attached is the ELD's source file and PDF's of source code.

Attached Thumbnails
Global Dictionary sender and receiver-__templatesendergdict.pdf   Global Dictionary sender and receiver-__templatereceivergdict.pdf  
Attached Files
Elite Membership required to download: _GlobalVarsTemplate.ELD
Reply With Quote
Thanked by:
  #5 (permalink)
 bob314159 
boulder, colorado
 
Experience: Advanced
Platform: TradeStation
Trading: emini's
Posts: 56 since Jun 2010
Thanks Given: 3
Thanks Received: 63

What are the names of what is contained in this ELD? I find only Global (p=100) and Global (p=100) SID, neither of which contains a template.

Reply With Quote
  #6 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,436 since Apr 2013
Thanks Given: 482
Thanks Received: 1,629

bob314159,

I haven't looked at the code, but from what I understand there is a sender and receiver part which is the template. As in use this as a foundation and expand/modify it to your needs.
What are you looking for or did you expect?

Regards,
ABCTG


bob314159 View Post
What are the names of what is contained in this ELD? I find only Global (p=100) and Global (p=100) SID, neither of which contains a template.


Follow me on Twitter Reply With Quote
  #7 (permalink)
 bob314159 
boulder, colorado
 
Experience: Advanced
Platform: TradeStation
Trading: emini's
Posts: 56 since Jun 2010
Thanks Given: 3
Thanks Received: 63

Scratch that. The names are shown in the download.

Reply With Quote
  #8 (permalink)
jsftrader
Curacao
 
Posts: 4 since Jun 2018
Thanks Given: 1
Thanks Received: 1

I trying to use the Collection for GlobalDictionary, but the variables do not seem to be read in other charts.

Using
If myGlobal.Contains( "share_name" ) <> False Then Print("True") Else Print("False");

Always results in a False on the receiving chart.

Is there a change in Tradestation 10. Any help will be appreciated.

Reply With Quote
  #9 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,436 since Apr 2013
Thanks Given: 482
Thanks Received: 1,629

jsftrader,

does the code work in TS 9.5?

Regards,

ABCTG


jsftrader View Post
I trying to use the Collection for GlobalDictionary, but the variables do not seem to be read in other charts.

Using
If myGlobal.Contains( "share_name" ) <> False Then Print("True") Else Print("False");

Always results in a False on the receiving chart.

Is there a change in Tradestation 10. Any help will be appreciated.


Follow me on Twitter Reply With Quote
  #10 (permalink)
jsftrader
Curacao
 
Posts: 4 since Jun 2018
Thanks Given: 1
Thanks Received: 1



ABCTG View Post
jsftrader,

does the code work in TS 9.5?

Regards,

ABCTG

The coding was copied that worked on 9.5, and the commands work on TS10 but only inside the same chart. The GlobalDictionary variables cannot be read by an other chart.

When TS changed to (i believe) 9.1, a setting had to be changed. Something to do with Shared CPU. I was wondering if the same is needed for TS10, but I cannot find the setting.

Reply With Quote




Last Updated on November 27, 2020


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
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.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts