Gamestudio Links
Zorro Links
Newest Posts
Trading Journey
by howardR. 04/28/24 09:55
basik85278
by basik85278. 04/28/24 08:56
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
Help with plotting multiple ZigZag
by M_D. 04/26/24 20:03
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
M1 Oversampling
by jcl. 04/26/24 11:12
Why Zorro supports up to 72 cores?
by jcl. 04/26/24 11:09
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (AndrewAMD, NeoDumont), 761 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
wandaluciaia, Mega_Rod, EternallyCurious, howardR, 11honza11
19049 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Connor's RSI 2 script #473583
07/24/18 14:48
07/24/18 14:48
Joined: Dec 2017
Posts: 19
M
Materz Offline OP
Newbie
Materz  Offline OP
Newbie
M

Joined: Dec 2017
Posts: 19
Dear All,

Still having problem with my script, unable to open trades ;

//**** ConnorsRSI Short Term Trading Strategy ** //
function run()
{

BarPeriod = 60; // 1 hour bars
LookBack = 500;
StartDate = 2012;
EndDate = 2013;

vars Price = series(priceClose());
vars Close = series(priceClose());
vars SMAFast = series(SMA(Close,5)); // Fast SMA for Position trigger
vars TrendSMA = series(SMA(Close,200)); // Slow SMA for Trend Direction
vars cRSI = series(ConnorsRSI(Close,2,3,100)); // ConnorsRSI
int Threshold1=90;
int Threshold2= 10;
Capital= 5000;




// ** set up max trades ** //

MaxLong = MaxShort = 1;

// ** Type ** //
//while(asset(loop("EUR/USD","USD/JPY")))

while(asset(loop("EUR/USD")))



Margin = 0.5 * OptimalF * Capital;

// *** Condition for Buy *** //

if(Price > TrendSMA && Price < SMAFast && crossUnder(cRSI,Threshold2))

//
enterLong();


// ** Exit Long Position ** //

if( NumOpenLong >0 && Price > SMAFast)

exitLong();

// *** Condition for Sell *** //

if(Price < TrendSMA && Price > SMAFast && crossOver(cRSI,Threshold1))

enterShort();

// ** Exit Short Position ** //

if(NumOpenShort >0 && Price < SMAFast)

exitShort();

}

Re: Connor's RSI 2 script [Re: Materz] #473627
07/28/18 17:09
07/28/18 17:09
Joined: Sep 2003
Posts: 929
Spirit Offline

Moderator
Spirit  Offline

Moderator

Joined: Sep 2003
Posts: 929
if(Price > TrendSMA

That make no sense with series, maybe you meant not Price, but Price[0]?


Moderated by  Petra 

Powered by UBB.threads™ PHP Forum Software 7.7.1