TOS fold loop to easylanguage - futures io
futures io futures trading



TOS fold loop to easylanguage


Discussion in EasyLanguage Programming

Updated
    1. trending_up 889 views
    2. thumb_up 0 thanks given
    3. group 3 followers
    1. forum 2 posts
    2. attach_file 0 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
 

TOS fold loop to easylanguage

(login for full post details)
  #1 (permalink)
Seattle, WA/USA
 
Experience: Intermediate
Platform: TOS, TS
Trading: Forex, crude
 
Posts: 88 since Sep 2016
Thanks: 7 given, 32 received

Hi all,
I'm trying to convert a TOS script that I have to tradestation and I'm having a doosey of a time figuring this out. I'm relatively new to TS and have only a fairly basic level of programming knowledge, so I'm hoping someone with more knowledge of loops than I can lend a hand.

Original TOS code:
 
Code
#Classify Volumes
def V_Rank         = fold vi = -4 to 5 with iVRank = 0 do if V > Power(Double.E, V_LNmu + V_LNsigma * ((vi == -4) * ((-V_LNmu + Log(TickSize() / 2) / V_LNsigma)) + (vi == -3) * (-1 * ExtremeDev) + (vi == -2) * (-1 * LargeDev) + (vi == -1) * (-1 * AboveNormalDev) + (vi ==  0) * (-1 * NormalDev) + (vi ==  1) * (NormalDev) + (vi ==  2) * (AboveNormalDev) + (vi ==  3) * (LargeDev) + (vi ==  4) * (ExtremeDev))) then vi else iVRank;
What I've got in TS so far (it's rather pathetic):
 
Code
Const:
	e(2.71828);
//Classify Volumes
For vi = -4 to 5 w
Begin 
	while ivRank = 0;
	if V > Power(e, V_LNmu + V_LNsigma * ((vi = -4) * ((-V_LNmu + Log(TickSize() / 2) / V_LNsigma)) + (vi = -3) * (-1 * ExtremeDev) + (vi = -2) * (-1 * LargeDev) + (vi = -1) * (-1 * AboveNormalDev) + (vi =  0) * (-1 * NormalDev) + (vi =  1) * (NormalDev) + (vi =  2) * (AboveNormalDev) + (vi =  3) * (LargeDev) + (vi =  4) * (ExtremeDev))) 
	then V_Rank = vi else V_Rank = iVRank;

Follow me on Twitter 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
NT8 indicator to simulate a Funding Evaluation where to …
NinjaTrader
Work with historical tcks data on MUltichart NET PowerLa …
MultiCharts
Indicators for pair trading MES and M2K
Platforms and Indicators
If ES tracks SPX, why do support/resistance, Level 2, vo …
Emini and Emicro Index
 
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)
Las Cruces, NM
 
Experience: Advanced
Platform: Tradestation, MC, NT
Broker: TradeStation, IB
Trading: Liquid futures contracts
 
Posts: 56 since Sep 2009
Thanks: 379 given, 84 received


Hi kjhosken,

The TOS code is quite convoluted. Here is the EL code:

 
Code
Const: e(2.71828);
vars: V_rank(0), vi(0);
array: X[10](0);

V_rank = 0;

X[1] =  (-V_LNmu + Log(TickSize() / 2) / V_LNsigma);
X[2] = -1 * ExtremeDev;
X[3] =  (-1 * LargeDev);
X[4] = (-1 * AboveNormalDev);
X[5] = (-1 * NormalDev);
X[6] = NormalDev;
X[7] = AboveNormalDev;
X[8] = LargeDev;
X[9] = ExtremeDev;
X[10] = 0;

for vi = -4 to 5 begin
    if  V > Power(e, V_LNmu + V_LNsigma * (X[vi + 5])) then
        V_Rank = vi;
end;

Reply With Quote


futures io Trading Community Platforms and Indicators EasyLanguage Programming > TOS fold loop to easylanguage


Last Updated on February 27, 2019


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