NexusFi: Find Your Edge


Home Menu

 





Convert tradeStation code in tradingview


Discussion in TradeStation

Updated
      Top Posters
    1. looks_one luminaryfi with 2 posts (2 thanks)
    2. looks_two philipina with 1 posts (0 thanks)
    3. looks_3 tr472 with 1 posts (0 thanks)
    4. looks_4 Ozquant with 1 posts (3 thanks)
    1. trending_up 5,866 views
    2. thumb_up 5 thanks given
    3. group 4 followers
    1. forum 4 posts
    2. attach_file 0 attachments




 
Search this Thread
  #1 (permalink)
philipina
blastoria belgium
 
Posts: 1 since Mar 2020
Thanks Given: 0
Thanks Received: 0

Hello,

I recently bought the book "Entry and Exit confessions of a champion trader".
This book provides samples of entry and exit point for algo trading and the code provided is code which can be used with TradeStation.

I'm not using TradeStation but instead I work with tradingview for my analysis.
Would you know if there are tools existing to convert tradeStation code to TradingView code?

Thanks in advance

Alain


Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Peace Deal Forward Curve: May 22%, June 51%, December 81 …
Prediction Markets & Event Contracts
Iran Peace Expired NO: Ceasefire on Life Support, OPEC a …
Prediction Markets & Event Contracts
Al Arabiya: US-Iran Draft Deal Within Hours Contains Hor …
Prediction Markets & Event Contracts
Beijing Summit Closes: Xi Pledges Hormuz Help -- $1.14B …
Prediction Markets & Event Contracts
El Clasico Draws $9.2M in Prediction Market Action -- Bi …
Prediction Markets & Event Contracts
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
NexusFi site changelog and issues/problem reporting
16 thanks
Darmok and Jalad at Tanagra
3 thanks
Big Mike in Ecuador
1 thanks
30 Sessions
1 thanks
  #2 (permalink)
luminaryfi
Indianapolis, Indiana
 
Posts: 10 since Jun 2020
Thanks Given: 0
Thanks Received: 8

Nope. Unfortunately, code translators don't exist (yet... FaceBook is working on one). You'll need to learn PineScript for TradingView.
https://www.tradingview.com/pine-script-docs/en/v4/index.html.
From what I've read about EasyLanguage it's somewhat related to Pascal (which I have no experience in whatsoever). PineScript is related more closely to JavaScript. Coding languages are like real languages in that Spanish is different than Portuguese.

Sent using the NexusFi mobile app


Reply With Quote
  #3 (permalink)
Ozquant
Brisbane Queensland Australia
 
Posts: 222 since Aug 2017
Thanks Given: 171
Thanks Received: 382



philipina View Post
Hello,

I recently bought the book "Entry and Exit confessions of a champion trader".
This book provides samples of entry and exit point for algo trading and the code provided is code which can be used with TradeStation.

I'm not using TradeStation but instead I work with tradingview for my analysis.
Would you know if there are tools existing to convert tradeStation code to TradingView code?

Thanks in advance

Alain

I can write Tradingview Pinescript and i understand Easy Language , Post the tradestation code here and i will see what i can do for you


Reply With Quote
  #4 (permalink)
luminaryfi
Indianapolis, Indiana
 
Posts: 10 since Jun 2020
Thanks Given: 0
Thanks Received: 8

Wow, people are so nice here! I just joined today.
Ozquant View Post
I can write Tradingview Pinescript and i understand Easy Language , Post the tradestation code here and i will see what i can do for you

Sent using the NexusFi mobile app


Reply With Quote
Thanked by:
  #5 (permalink)
tr472
georgetown
 
Posts: 1 since Sep 2020
Thanks Given: 0
Thanks Received: 0


Ozquant View Post
I can write Tradingview Pinescript and i understand Easy Language , Post the tradestation code here and i will see what i can do for you

/@version=4
study("Freedom Fib",overlay=true)
dev_threshold = input:Fibonacci ("lines" = input "float"), defval=1,minival=0);
inputtitle="depth",type=input.integer, defval=1,minival=1);
Period_EMA=inputtitle="EMA Period/0 forVWAP",defval=13);
firstlevalalignment= inputfalse, "false, "First level alignment with EMA"13);
var: extendLeft = inputfalse,"Extend Lines Left");
var: extendRight: = inputtrue, "Extend Lines Right");
var RiskSize: = inputtrue, "sizing Help");
MaxRisk = inputtitle="Max Risk Amount",defval=100
EMAChosen = ema(close,Period_EMA);
ma=0.0;
if period_EMA > 0
ma:=ema(close,Period_EMA);
Elsema:=Vwap;
var: extending = extend.none
if extendLeft and extendRigh
extending := extend.both
if extendLeft and not extendRight
extending := extend.left
if not extendLeft and extendRight
extending:= extend.right
reverse = input(false, Reverse");
prices + input(true, "Prices");
levels = input(false, "Levels");
levelsFormat = input("values", "levels Format", options=["values", "percent"];
var: line lineLast= na
var: int iLast = 0
var: int iPrev = 0
var: float pLast = 0
var: isHighLast = =false // otherwise the last pivot is a low pivot;
var: oldstartprice = 0
var: oldendprice = 0
pivots(src, lenght, is high) =>
l2 = length * 2;
c = nz(src[length, is high) =>
c = nz(src[length]);
ok = true;
for i = 0 to 8
if isHigh and src[i] > c
ok := false;
if not isHigh and src[i] < c
ok := false;
if ok;
[bar_index[length], c];
else;
[int(na), float(na)];
[iH, pH] = pivots(high, depth / 2, true);
[iL, pL] = pivots(low, depth / 2, false);
calc_dev(base_price, price) =>
100 * (price - base_price) / price;
pivotFound(dev, isHigh, index, price) =>
if isHighLast == isHigh and not na(lineLast);
// same direction
if isHighLast ? price > pLast : price < pLast
line.set_xy2(lineLast, index, price);
[lineLast, isHighLast];
else
[line(na), bool(na)];
else // reverse the direction (or create the very first line)
if abs(dev) > dev_threshold
// price move is significant
id = line.new(iLast, pLast, index, price, color=color.gray, width=1,
FREEDOM FIB - Friday, September 25, 2020, 21:13:03
Page: 2 Printed using TradeStation. TradeStation Technologies, Inc. All rights reserved. �
style=line.style_dashed);
[id, isHigh];
else
[line(na), bool(na)];
if not na(iH)
dev = calc_dev(pLast, pH);
[id, isHigh] = pivotFound(dev, true, iH, pH);
if not na(id);
if id != lineLast
line.delete(lineLast);
lineLast := id
isHighLast := isHigh
iPrev := iLast
iLast := iH
pLast := pH
else
if not na(iL);
dev = calc_dev(pLast, pL);
[id, isHigh] = pivotFound(dev, false, iL, pL);
if not na(id);
if id != lineLast
line.delete(lineLast);
lineLast := id
isHighLast := isHigh
iPrev := iLast
iLast := iL
pLast := pL
_draw_line(price, col) =>
var: id = line.new(iLast, price, bar_index, price, color=col, width=1, extend=extending);
if not na(lineLast);
line.set_xy1(id, line.get_x1(lineLast), price);
line.set_xy2(id, line.get_x2(lineLast), price);
dt = time - time[1];
mf = firstlevelalignment ? 3 : 6
_draw_label(price, txt, txtColor) =>
var: id = label.new(x = time + (dt * mf), y=price, text=txt, textcolor=txtColor,
style=label.style_none, xloc = xloc.bar_time, yloc = yloc.price);
label.set_xy(id, time + (dt * mf), price);
label.set_text(id, txt);
label.set_textalign(id, text.align_right);
label.set_textcolor(id, txtColor);
//_draw_label(price, txt, txtColor) =>;
// var id = label.new(x=line.get_x1(lineLast), y=price, text=txt, textcolor=txtColor,
style=label.style_none);
// label.set_xy(id, line.get_x1(lineLast), price);
// label.set_text(id, txt);
// label.set_textcolor(id, txtColor);
_wrap(txt) =>
"(" + tostring(txt, "#.##") + ")"
_label_txt(level, price) =>;
l = levelsFormat == "Values" ? tostring(level) : tostring(level * 100) + "%"
(levels ? l : "") + (prices ? _wrap(price) : "");
//_risk_txt(risk, price) =>;
// l = levelsFormat == "Values" ? tostring(risk) : tostring(risk * 100) + "%"
// (RiskSize ? l : "") + (prices ? _wrap(price) : "");
_risk_txt(risk, order, price) =>;
l = levelsFormat == "Values" ? " "+ tostring(risk)+" : "+tostring(order): tostring(risk *
100) + "%"
(prices ? _wrap(price) : "") + (RiskSize ? l : "");
var: sl1 = input(true, "0");
var:vall1 = -0.0908
FREEDOM FIB - Friday, September 25, 2020, 21:13:03
Page: 3 Printed using TradeStation. TradeStation Technologies, Inc. All rights reserved. �
var: sl2 = input(true, "1");
var:vall2 = 0.091
var: ( (sl3)= input(true, "2");
var: vall3 = 0.2728
var: sl4 = input(true, "3");
var: vall4 = 0.4546
var: sl5 = input(true, "4");
var: vall5 = 0.6364
var: sl6 = input(true, "5");
var: vall6 = 0.8182
var: sl7 = input(true, "6");
var: vall7 = 1.0
var: sl8 = input(true, "7");
var: vall8 = 1.1818
var: sl9 = input(true, "10");
var: vall9 = 1.7272
if (firstlevelalignment);
sl1 := input(true, "0");
vall1 := -0.1667
sl2 := inputtrue, "1");
vall2 := 0
sl3 := inputtrue, "2");
vall3 := 0.1667
sl4 := inputtrue, "3");
vall4 := 0.3333
sl5 := inputtrue, "4");
vall5 := 0.5
sl6 := inputtrue, "5");
vall6 := 0.6667
sl7 := inputtrue, "6");
vall7 := 0.8333
sl8 := inputtrue, "7");
vall8 := 1.0
sl9 := inputtrue, "10");
vall9 := 1.5
_draw_retracement(startPrice, endPrice) =>
risk_cents = 0.0
iHL = startPrice > endPrice
diff = (iHL ? -1 : 1) * abs(startPrice - endPrice);
if sl1
l1 = startPrice + diff * vall1
risk_cents := l1
_draw_line(l1, #ffffff);
_draw_label(l1, _label_txt(vall1, l1), #ffffff);
if sl2
l2 = startPrice + diff * vall2
_draw_line(l2, #00FF00)
_draw_label(l2, _label_txt(vall2, l2), #00FF00);
if sl3
l3 = startPrice + diff * vall3
risk_cents := l3 - risk_cents
FREEDOM FIB - Friday, September 25, 2020, 21:13:03
Page: 4 Printed using TradeStation. TradeStation Technologies, Inc. All rights reserved. �
proper_sizing = abs (round (MaxRisk / risk_cents));
per_order = abs(round(proper_sizing/3));
_draw_line(l3, #ADFF2F);
//_draw_label(l3, _risk_txt(abs(proper_sizing), l3), #ADFF2F);
_draw_label(l3, " " + _risk_txt(proper_sizing, per_order, l3), #ADFF2F);
if sl4
l4 = startPrice + diff * vall4
_draw_line(l4, #32CD32);
_draw_label(l4, _label_txt(vall4, l4), #32CD32);
if sl5
l5 = startPrice + diff * vall5
_draw_line(l5, #add8e6);
_draw_label(l5, _label_txt(vall5, l5), #add8e6);
if sl6
l6 = startPrice + diff * vall6
_draw_line(l6, #b400f3);
_draw_label(l6, _label_txt(vall6, l6), #b400f3);
if sl7
l7 = startPrice + diff * vall7
_draw_line(l7, #808080);
_draw_label(l7, _label_txt(vall7, l7), #808080);
if sl8
l8 = startPrice + diff * vall8
_draw_line(l8, #5555ff);
_draw_label(l8, _label_txt(vall8, l8), #5555ff);
if sl9
l9 = startPrice + diff * vall9
_draw_line(l9, #ffc0cb);
_draw_label(l9, _label_txt(vall9, l9), #ffc0cb);
p1 = reverse ? line.get_y1(lineLast) Last
p2 = reverse ? line.get_y1(lineLast) : pLast
_draw_retracement(ma, p2);


Reply With Quote




Last Updated on October 30, 2020


© 2026 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 - Downloads - Top
no new posts