GlobalDictionary - incredibly inefficient calculations? - TradeStation | futures io social day trading
futures io futures trading


GlobalDictionary - incredibly inefficient calculations?
Updated: Views / Replies:109 / 3
Created: by technoloG Attachments:0

Welcome to futures io.

(If you already have an account, login at the top of the page)

futures io is the largest futures trading community on the planet, with over 100,000 members. At futures io, our goal has always been and always will be to create a friendly, positive, forward-thinking community where members can openly share and discuss everything the world of trading has to offer. The community is one of the friendliest you will find on any subject, with members going out of their way to help others. Some of the primary differences between futures io and other trading sites revolve around the standards of our community. Those standards include a code of conduct for our members, as well as extremely high standards that govern which partners we do business with, and which products or services we recommend to our members.

At futures io, our focus is on quality education. No hype, gimmicks, or secret sauce. The truth is: trading is hard. To succeed, you need to surround yourself with the right support system, educational content, and trading mentors Ė all of which you can find on futures io, utilizing our social trading environment.

With futures io, you can find honest trading reviews on brokers, trading rooms, indicator packages, trading strategies, and much more. Our trading review process is highly moderated to ensure that only genuine users are allowed, so you donít need to worry about fake reviews.

We are fundamentally different than most other trading sites:
  • We are here to help. Just let us know what you need.
  • We work extremely hard to keep things positive in our community.
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts.
  • We firmly believe in and encourage sharing. The holy grail is within you, we can help you find it.
  • We expect our members to participate and become a part of the community. Help yourself by helping others.

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

Thread Tools Search this Thread

GlobalDictionary - incredibly inefficient calculations?

  #1 (permalink)
Trading Apprentice
Walnut Creek, CA/USA
Futures Experience: Beginner
Platform: Tradestation
Favorite Futures: Crude CL, Dow YM
Posts: 5 since Sep 2018
Thanks: 1 given, 0 received

GlobalDictionary - incredibly inefficient calculations?

Hi all,

so I was trying to come up with a way to more efficiently backtest/optimize parameters for my strategies, and I was thinking that several parameters should probably match (e.g. length of bars to consider).

After some digging, I saw a post which detailed how to use a GlobalDictionary for a sender/receiver(s), so that I might be able to have the receivers (say, entry/exit strategies) use the same parameters as the sender (say, indicator(s) from which strategies are based). The problem I'm running into is that trying to invoke the GlobalDictionary alone (to, for example, set the values in the dictionary as part of the indicator calculation) appears to slow my indicator/strategy calculations by quite a lot... So much so that it makes even generating the indicator by itself take at least 10x as long as it otherwise would. Am I doing something wrong here? Is this expected behavior with the GlobalDictionary? Or is there a different construct I should be using instead?

Thank you!

Reply With Quote
  #2 (permalink)
Trading Apprentice
Walnut Creek, CA/USA
Futures Experience: Beginner
Platform: Tradestation
Favorite Futures: Crude CL, Dow YM
Posts: 5 since Sep 2018
Thanks: 1 given, 0 received

found another option, but still same issue

After doing some searching, I found another construct that allows sharing between analysis techniques and strategies: GlobalValue. This, too, appears to suffer from the same problem...

Reply With Quote
  #3 (permalink)
Trading Apprentice
Walnut Creek, CA/USA
Futures Experience: Beginner
Platform: Tradestation
Favorite Futures: Crude CL, Dow YM
Posts: 5 since Sep 2018
Thanks: 1 given, 0 received

Pass by Reference: also doesn't work

An update:

So, I was able to use GlobalValue, but upon trying to optimize inputs, I was informed that "GlobalDictionary does not support multithreaded...*stuff*". My last thought then was to pass in a bunch of numericrefs, one set of them so that the "sender" could update the values, and another set so that the "receiver" can grab them from the function once they're set... Much to my dismay, it would appear as though each strategy creates its own instance of the function. So, the assumption of being able to use the numericrefs as a sort of sender/receiver contract was false. I am now at a loss... Is it really not possible to have multiple strategies adhere to the same inputs, without setting them all to the same thing, and making optimization of parameters nearly worthless (since they're almost certainly going to use different lengths for the computations after optimization, even though they're based on the same indicator)? Any advice here would be greatly appreciated!

Also.. I think it would be possible to do as I describe by using a super mondo strategy that encompasses both the entry as well as the exits, but the programmer in me believes that to be a terrible solution due to separation of concerns and all this... There has to be a better way

Last edited by technoloG; November 3rd, 2018 at 10:32 PM. Reason: Adding additional info for question
Reply With Quote
  #4 (permalink)
Hamburg Germany
Futures Experience: Advanced
Platform: Multicharts, Tradestation
Broker/Data: DTN IQ
Favorite Futures: ES
Posts: 1,831 since Apr 2013
Thanks: 297 given, 1,115 received
Forum Reputation: Legendary


it sounds like your Global Dictionary is not configured for multi threading as this shouldn't be a problem.
Check out the example in the help file:
To create an instance of GlobalDictionary to share values within same window type:

myGlobal = GlobalDictionary.create();

To create an instance of GlobalDictionary to share values beyond the same window type or between two charts when multi-core charting is enabled.

myGlobal = GlobalDictionary.create(true, "share_name");
In general I would say that the Dictionary is likely the bottleneck of your code and reducing calls to it to a minimum should speed up things (although the end result will likely still be slower than code without the dictionary). For example not reading the values on every tick/bar, but using the event handlers to only read the values when there was a change should speed things up.



Reply With Quote


futures io > > > > GlobalDictionary - incredibly inefficient calculations?

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Upcoming Webinars and Events (4:30PM ET unless noted)

Journal Challenge w/Earn2Trade and $599 in Prizes


Anthony Drager: TBA

Nov 29

Linda Raschke: TBA

Elite only

Peter Davies: TBA

Dec 6

Brannigan Barrett: TBA

Elite only

Cannon Trading: Ask Me Anything

Dec 13

Similar Threads
Thread Thread Starter Forum Replies Last Post
Exclude empty values for calculations tonycashflow NinjaTrader Programming 7 June 23rd, 2014 12:15 PM
UpTick/Downtick Calculations clement EasyLanguage Programming 3 January 13th, 2012 02:14 AM
Pivot Point calculations trendisyourfriend Investor/RT 11 May 2nd, 2011 07:50 PM
Slippage Calculations for Optimization benharrell Traders Hideout 7 December 20th, 2010 04:53 AM
OHLC calculations indicator vast NinjaTrader Programming 3 January 16th, 2010 06:43 AM

backtest, backtesting, dow, es, global dictionary, how to, indicator, indicators, strategies, strategy, tradestation, type, update, values

All times are GMT -4. The time now is 11:14 PM. (this page content is cached, log in for real-time version)

Copyright © 2018 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, +507 833-9432,
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
Page generated 2018-11-15 in 0.07 seconds with 22 queries on phoenix