STC strategy

Closed Posted 1 year ago Paid on delivery
Closed

STC strategy , I have a code from tradingview to start with but it does not work when it comes to inputting a trade, do does plot the trade. I'd like to have the option to use equity at 90% in future trades. I'd like the pine script to work on tradestation and tradingview.

//@version=4

// Copyright (c) 2018-present, Alex Orekhov (everget)

// Schaff Trend Cycle script may be freely distributed under the MIT license.

//@version=3

strategy("Schaff Trend Cycle Strategy", shorttitle="STC Backtest", overlay=true)

// Create inputs

fastLength = input(title="MACD Fast Length", type=integer, defval=23)

slowLength = input(title="MACD Slow Length", type=integer, defval=50)

cycleLength = input(title="Cycle Length", type=integer, defval=10)

d1Length = input(title="1st %D Length", type=integer, defval=3)

d2Length = input(title="2nd %D Length", type=integer, defval=3)

src = input(title="Source", type=source, defval=close)

highlightBreakouts = input(title="Highlight Breakouts ?", type=bool, defval=true)

macd = ema(src, fastLength) - ema(src, slowLength)

k = nz(fixnan(stoch(macd, macd, macd, cycleLength)))

d = ema(k, d1Length)

kd = nz(fixnan(stoch(d, d, d, cycleLength)))

stc = ema(kd, d2Length)

stc := stc > 100 ? 100 : stc < 0 ? 0 : stc

upper = input(75, defval=75)

lower = input(25, defval=25)

long = crossover(stc, lower) ? lower : na

short = crossunder(stc, upper) ? upper : na

long_filt = long and not short

short_filt = short and not long

prev = 0

prev := long_filt ? 1 : short_filt ? -1 : prev[1]

long_final = long_filt and prev[1] == -1

short_final = short_filt and prev[1] == 1

//alertcondition(long_final, "Long", message="Long")

//alertcondition(short_final,"Short", message="Short")

//plotshape(long_final, style=[login to view URL], text="Long", color=green, location=[login to view URL])

//plotshape(short_final, style=[login to view URL], text="Short", color=red, location=[login to view URL])

// Submit orders

[login to view URL]("long", [login to view URL], when = long )

[login to view URL]("short", [login to view URL], when = short)

Metatrader Pine Script Software Architecture MetaTrader 4 Python TradeStation Trading

Project ID: #35673461

About the project

1 proposal Remote project Active 1 year ago

1 freelancer is bidding on average $38 for this job

zivkovicdevelop1

Hello⭐⭐⭐⭐⭐PYTHON/golang and Django Developer⭐⭐⭐⭐⭐ I have read your job description carefully and I am sure this is a good fit with my talent python/golang dev skill. As a senior full-stack web developer with 10+ years More

$38 USD / hour
(37 Reviews)
6.4