Convert Think or Swim to Pine Script for TradingView

Other Diseño

Trabajo finalizado

Plazo de ejecución 2 horas
Comentario del Ejecutor
Thanks for the job
Comentario del Cliente
Brilliant! Excellent coder!

Tarea técnica

# Settings
input MACD = yes;
input BollingerBands = yes;
input OldSignal = no;
input SupplyDemand = no;
input Labels = yes;
input limit_cloud = no;
input cloud_length = 10;


# Bollinger Bands
input displace = 0;
input lengthBB = 20;
input Num_Dev_Dn = -2.0;
input Num_Dev_up = 2.0;
input averageTypeBB = AverageType.Simple;
input price = close;
def oAtfh6n = stdev(data = price[-displace], length = lengthBB);
def aM5xu7k = MovingAverage(averageTypeBB, data = price[-displace], length = lengthBB);
def dI2hs07 = aM5xu7k + num_Dev_Dn * oAtfh6n;
def cCdm4cd = aM5xu7k + num_Dev_Up * oAtfh6n;
def gD4q0z5 = price crosses above dI2hs07;
def jRvqeoe = price crosses below cCdm4cd;


# RSI
input length = 14;
input over_Bought = 70;
input over_Sold = 30;
input over_Bought2 = 65;
input over_Sold2 = 35;
input averageType = AverageType.WILDERS;
def vTx3j8c = MovingAverage(averageType, price - price[1], length);
def gIl5r7s = MovingAverage(averageType, AbsValue(price - price[1]), length);
def tA4qhjg = if gIl5r7s != 0 then vTx3j8c / gIl5r7s else 0;
def RSI = 50 * (tA4qhjg + 1);
def mFzzstv = over_Sold;
def pKmsxdf = over_Bought;
# End RSI


# MACD
input fastLength = 12;
input slowLength = 26;
input MACDLength = 9;
input MACDaverageType = AverageType.EXPONENTIAL;
def bZrnvi0 = MovingAverage(MACDaverageType, close + (close - close[(fastlength - 1) / 2]), fastLength) - MovingAverage(MACDaverageType, close + (close - close[(slowLength - 1) / 2]), slowLength);
def cOxk8kt = MovingAverage(MACDaverageType, bZrnvi0, MACDLength);
def pF6uf3l = bZrnvi0 - cOxk8kt;
def dFgleep = pF6uf3l crosses above 0;
def vMss0gi = pF6uf3l crosses below 0;
# END MACD


# Moving Average
input priceMA = close;
input lengthMA = 5;
input showBreakoutSignals = yes;
def mSng78b = Average(priceMA[-displace], lengthMA);
def uTev1a2 = priceMA crosses above mSng78b;
def rPy3y4n = priceMA crosses below mSng78b;


# Old Signals
def mGu36uc = RSI(length = length, averageType = averageType) < over_Sold2 and uTev1a2;
def jEhoesi = RSI(length = length, averageType = averageType) > over_Bought2 and rPy3y4n;


# BB Signals
def lK8vc4f = RSI(length = length, averageType = averageType) < over_Sold and gD4q0z5;
def bKxom7g = RSI(length = length, averageType = averageType) > over_Bought and jRvqeoe;


# MCD Signals
def gA43ixk = RSI(length = length, averageType = averageType) < over_Sold2 and dFgleep;
def wFgpycr = RSI(length = length, averageType = averageType) > over_Bought2 and vMss0gi;


# Plot Signals
plot bullish_bb = if BollingerBands then lK8vc4f else double.nan;
bullish_bb.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
bullish_bb.SetDefaultColor(Color.CYAN);
bullish_bb.SetLineWeight(2);
plot bearish_bb = if BollingerBands then bKxom7g else double.nan;
bearish_bb.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);
bearish_bb.SetDefaultColor(Color.CYAN);
bearish_bb.SetLineWeight(2);


# Cont.
plot bullish_mcd = if MACD then gA43ixk else double.nan;
bullish_mcd.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
bullish_mcd.SetDefaultColor(Color.MAGENTA);
bullish_mcd.SetLineWeight(2);
plot bearish_mcd = if MACD then wFgpycr else double.nan;
bearish_mcd.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);
bearish_mcd.SetDefaultColor(Color.MAGENTA);
bearish_mcd.SetLineWeight(2);


# Cont. #2
plot lZ15z9i = if OldSignal and mGu36uc then mGu36uc else double.nan;
lZ15z9i.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
lZ15z9i.SetDefaultColor(Color.WHITE);
lZ15z9i.SetLineWeight(1);
plot fMqt6x4 = if OldSignal and jEhoesi then jEhoesi else double.nan;
fMqt6x4.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);
fMqt6x4.SetDefaultColor(Color.WHITE);
fMqt6x4.SetLineWeight(1);


# Supply and Demand Zone #1
def dHwh1h2 = if lK8vc4f or bKxom7g then 1 else 0;
def tCa2kqh = if dHwh1h2 then high else tCa2kqh[1];
def zVtogal = if dHwh1h2 then low else zVtogal[1];
def kZuxbiv = if dHwh1h2 then 1 else kZuxbiv[1] + 1;
plot fP699b2 = if SupplyDemand and limit_cloud == no or limit_cloud == yes and kZuxbiv <= cloud_length then tCa2kqh
else Double.NaN;
plot kUce1w6 = if SupplyDemand and limit_cloud == no or limit_cloud == yes and kZuxbiv <= cloud_length then zVtogal
else Double.NaN;
fP699b2.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
kUce1w6.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
fP699b2.SetDefaultColor(Color.GRAY);
kUce1w6.SetDefaultColor(Color.GRAY);
addCloud(if SupplyDemand == yes then kUce1w6 else double.nan, kUce1w6, Color.CYAN, Color.CYAN);
addCloud(if SupplyDemand == yes then kUce1w6 else double.nan, fP699b2, Color.CYAN, Color.CYAN);


# Supply and Demand Zone #2
def qQibh70 = if gA43ixk or wFgpycr then 1 else 0;
def kE0y5jh = if qQibh70 then high else kE0y5jh[1];
def mCgv0ps = if qQibh70 then low else mCgv0ps[1];
def aAe6e6d = if qQibh70 then 1 else aAe6e6d[1] + 1;
plot qXv3kyo = if SupplyDemand and limit_cloud == no or limit_cloud == yes and aAe6e6d <= cloud_length then kE0y5jh
else Double.NaN;
plot kJilo78 = if SupplyDemand and limit_cloud == no or limit_cloud == yes and aAe6e6d <= cloud_length then mCgv0ps
else Double.NaN;
qXv3kyo.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
kJilo78.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
qXv3kyo.SetDefaultColor(Color.GRAY);
kJilo78.SetDefaultColor(Color.GRAY);
addCloud(if SupplyDemand == yes then kJilo78 else double.nan, kJilo78, Color.MAGENTA, Color.MAGENTA);
addCloud(if SupplyDemand == yes then kJilo78 else double.nan, qXv3kyo, Color.MAGENTA, Color.MAGENTA);


AddLabel(Labels and yes, "Advanced Market Moves", color.Yellow);
AddLabel(Labels and yes, "Signal 1", color.CYAN);
AddLabel(Labels and yes, "Signal 2", color.MAGENTA);


Han respondido

1
Desarrollador 1
Evaluación
(38)
Proyectos
50
10%
Arbitraje
1
0% / 0%
Caducado
8
16%
Libre
2
Desarrollador 2
Evaluación
(94)
Proyectos
190
66%
Arbitraje
8
25% / 50%
Caducado
2
1%
Libre
3
Desarrollador 3
Evaluación
(10)
Proyectos
13
8%
Arbitraje
3
67% / 33%
Caducado
0
Libre
4
Desarrollador 4
Evaluación
(242)
Proyectos
271
65%
Arbitraje
6
17% / 33%
Caducado
8
3%
Trabajando
Solicitudes similares
Hi, I need to automate the supertrend indicator on ctrader with partial tp and sl. I already have a sort of script (without tp and sl) but when I go to compile it gives me an error. would you be able to make it work by adding the partial tp and sl
I need help for my auto trading with Futures using ThinkorSwim platform. I have a thinkscript I use to Buy and Sell futures. Currently I use these scripts and display on the chart (vertical line). Once I see the vertical line on the chart, I do the Buy/Sell. I want to automate this in TOS
3 main issues and features: + The platform uses candlestick data from Oanda Exchange + Features drawing lines and Fibo Retracement + There is a list to manage objects drawn on candlestick charts (Can be divided into groups and has the feature of hiding objects)
I would like to find someone who has already created a trading robot before. Im also looking for someone who can creat a bot that goes with time and structure
"I am looking to automate my Delta Divergence trading strategy for NinjaTrader 8. The strategy is thoroughly detailed in the accompanying script, and I need it to be implemented effectively in the platform."
Market entries are only performed between the hours of 8pm est to 10pm est At 8pm the very immediate high and low on the 15 min time frame is marked out Price has to break either the high or low before a trade is considered Selling Execution: After crossing the high on the 1 min time frame I’m looking for there to be a market structure shift with displacement (volume) to show price wants to go in the selling

Información sobre el proyecto

Presupuesto
45+ USD
Para el ejecutor
40.5 USD
Plazo límite de ejecución
a 5 día(s)