Code TRX Channel for TOS (MT4 Code here) - ThinkOrSwim Programming | futures trading

Go Back

> Futures Trading, News, Charts and Platforms > Platforms and Indicators > ThinkOrSwim > ThinkOrSwim Programming

Code TRX Channel for TOS (MT4 Code here)
Started:October 1st, 2014 (03:55 PM) by rommark Views / Replies:580 / 0
Last Reply:October 1st, 2014 (03:55 PM) Attachments:0

Welcome to

Welcome, Guest!

This forum was established to help traders (especially futures traders) by openly sharing indicators, strategies, methods, trading journals and discussing the psychology of trading.

We are fundamentally different than most other trading forums:
  • We work extremely hard to keep things positive on our forums.
  • We do not tolerate rude behavior, trolling, or vendor advertising in posts.
  • We firmly believe in openness and encourage sharing. The holy grail is within you, it is not something tangible you can download.
  • 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, and we will never resell your private information.

-- Big Mike

Thread Tools Search this Thread

Code TRX Channel for TOS (MT4 Code here)

Old October 1st, 2014, 03:55 PM   #1 (permalink)
Trading Apprentice
kazan russia
Futures Experience: Beginner
Favorite Futures: EUR/USD
Posts: 8 since Aug 2014
Thanks: 0 given, 1 received

Code TRX Channel for TOS (MT4 Code here)


Anyone could convert this TRX channel into TOS please?

#property indicator_chart_window
#property indicator_buffers 3
#property indicator_color1 Blue
#property indicator_color2 White
#property indicator_color3 Red

double g_ibuf_76[];
double g_ibuf_80[];
double g_ibuf_84[];
int g_period_88 = 20;

int init() {
SetIndexStyle(0, DRAW_LINE);
SetIndexShift(0, 0);
SetIndexDrawBegin(0, 0);
SetIndexBuffer(0, g_ibuf_76);
SetIndexStyle(1, DRAW_NONE);
SetIndexShift(1, 0);
SetIndexDrawBegin(1, 0);
SetIndexBuffer(1, g_ibuf_80);
SetIndexStyle(2, DRAW_LINE);
SetIndexShift(2, 0);
SetIndexDrawBegin(2, 0);
SetIndexBuffer(2, g_ibuf_84);
return (0);

int deinit() {
return (0);

int start() {
double ld_8;
if (ObjectType("TRX") != 23) ObjectDelete("TRX");
if (ObjectFind("TRX") == -1) ObjectCreate("TRX", OBJ_LABEL, 0, Time[5], Close[5]);
ObjectSetText("TRX", "Launcher TRX Indicator (R)");
ObjectSet("TRX", OBJPROP_CORNER, 4);
int li_4 = IndicatorCounted();
if (li_4 < 0) return (-1);
if (li_4 > 0) li_4--;
int li_0 = Bars - li_4;
for (int li_16 = 0; li_16 < li_0; li_16++) {
g_ibuf_80[li_16] = iMA(NULL, 0, g_period_88, 0, MODE_SMA, PRICE_TYPICAL, li_16);
ld_8 = findAvg(g_period_88, li_16);
g_ibuf_76[li_16] = g_ibuf_80[li_16] + 1.5 * ld_8;
g_ibuf_84[li_16] = g_ibuf_80[li_16] - 1.5 * ld_8;
double l_iatr_20 = iATR(Symbol(), 0, 50, 1);
if (High[0] == Low[0] && High[0] == Close[0] && High[0] == Open[0]) {
if (MathAbs(High[1] - g_ibuf_76[1]) < l_iatr_20 && g_ibuf_76[1] < g_ibuf_76[2]) Alert("[" + Symbol() + "] Possible Short on TRX Final, Please Confirm with Directional.");
if (MathAbs(Low[1] - g_ibuf_84[1]) < l_iatr_20 && g_ibuf_84[1] > g_ibuf_84[2]) Alert("[" + Symbol() + "] Possible Long on TRX Final, Please Confirm with Directional.");
return (0);

double findAvg(int ai_0, int ai_4) {
double ld_ret_8 = 0;
for (int li_16 = ai_4; li_16 < ai_4 + ai_0; li_16++) ld_ret_8 += High[li_16] - Low[li_16];
ld_ret_8 /= ai_0;
return (ld_ret_8);

Reply With Quote

Reply > Futures Trading, News, Charts and Platforms > Platforms and Indicators > ThinkOrSwim > ThinkOrSwim Programming > Code TRX Channel for TOS (MT4 Code here)

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

An Afternoon with FIO trader bobwest

Elite only

NinjaTrader 8: Programming Profitable Trading Edges w/Scott Hodson

Elite only

Anthony Drager: Executing on Intermarket Correlations & Order Flow, Part 2

Elite only

Adam Grimes: Five critically important keys to professional trading

Elite only

Machine Learning Concepts w/FIO member NJAMC

Elite only

MarketDelta Cloud Platform: Announcing new mobile features

Dec 1

NinjaTrader 8: Features and Enhancements

Dec 6

Similar Threads
Thread Thread Starter Forum Replies Last Post
Effort index indicator need code for mt4 timy MetaTrader 1 October 17th, 2013 03:19 AM
need a coder to code new NT7 indi from existing MT4 indi - I have source code traderdp Hire a Consultant or Programmer 0 January 31st, 2013 08:21 PM
yet another MT4 code to NT7 request? danjuma NinjaTrader 6 September 14th, 2012 01:29 PM
Can anyone convert a code from TOS j8fire ThinkOrSwim 8 July 18th, 2012 08:24 PM

All times are GMT -4. The time now is 09:31 PM.

Copyright © 2016 by 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 2016-10-24 in 0.06 seconds with 19 queries on phoenix via your IP