CRSI Strategy

If you need an Indicator or Signal developed or translated from other language, please post all Indicator development REQUESTS to this section here.

Moderator: admin

CRSI Strategy

Postby isamegrelo » Thu Aug 23, 2018 12:03 pm

Please create trading strategy from this formula. Condition for exit:
1. Stop loss or take profit
2. On next candle

Code:

strategy("RSI small trade strategy", overlay=true, precision=5, currency="AUD")

//--------------- input parameters

src = input(defval=close, type=source, title="Source")
lenrsi = input(3, minval=1, type=integer, title="RSI Length")
lenupdown = input(2, minval=1, type=integer, title="UpDown Length")
lenroc = input(100, minval=1, type=integer, title="ROC Length")

//--------------- define function

updown(s) =>
isEqual = s == s[1]
isGrowing = s > s[1]
ud = isEqual ? 0 : isGrowing ? (nz(ud[1]) <= 0 ? 1 : nz(ud[1])+1) : (nz(ud[1]) >= 0 ? -1 : nz(ud[1])-1)
ud

//--------------- calculate RSIs

rsi = rsi(src, lenrsi)
updownrsi = rsi(updown(src), lenupdown)
percentrank = percentrank(roc(src, 1), lenroc)
crsi = avg(rsi, updownrsi, percentrank)

//--------------- calculate signal

sig1 = (close >= open) and (crsi < (crsi[1] - 3)) ? 1 : na
sig2 = (close <= open) and (crsi > (crsi[1] + 3)) ? 1 : na
midline = input (68)
price = close

Take_Profit = input(50)
Stop_Loss = input(50)

longCondition = sig2
if (longCondition)
strategy.entry("LongEntry", strategy.long)
strategy.exit("LongExit", "LongEntry", profit = Take_Profit, loss = Stop_Loss)

shortCondition = sig1
if (shortCondition)
strategy.entry("ShortEntry", strategy.short)
strategy.exit("ShortExit", "ShortEntry", profit = Take_Profit, loss = Stop_Loss)


79.png
isamegrelo
FXCodeBase: Initiate
 
Posts: 114
Joined: Mon May 29, 2017 3:36 pm

Re: CRSI Strategy

Postby Apprentice » Sat Aug 25, 2018 6:33 am

Is it for MT4 of TS2?
User avatar
Apprentice
FXCodeBase: Confirmed User
 
Posts: 36435
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia

Re: CRSI Strategy

Postby isamegrelo » Sat Aug 25, 2018 8:31 am

For TS2
isamegrelo
FXCodeBase: Initiate
 
Posts: 114
Joined: Mon May 29, 2017 3:36 pm


Re: CRSI Strategy

Postby isamegrelo » Sat Aug 25, 2018 11:48 am

I'm sorry, this is other indicator :(
I need this version: viewtopic.php?p=118121#p118121
You create this indicator in March. ConnorsRSI_with_alert.tradingview.lua

And one important thing, open orders when divergence occurs (indicator's line go down - price go up: sell order, CRSI line go up - price go down: buy order)

8288.png
isamegrelo
FXCodeBase: Initiate
 
Posts: 114
Joined: Mon May 29, 2017 3:36 pm


Return to Indicator and Signal Requests

Who is online

Users browsing this forum: No registered users and 14 guests

cron