Gamestudio Links
Zorro Links
Newest Posts
loading historical data 1st time
by AndrewAMD. 04/14/23 12:54
Trade at bar open
by juanex. 04/13/23 19:43
Bug in Highpass2 filter
by rki. 04/13/23 09:54
Adding Limit Orders For IB
by scatters. 04/11/23 16:16
FisherN
by rki. 04/11/23 08:38
AUM Magazine
Latest Screens
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Hecknex World
Who's Online Now
2 registered members (Grant, AndrewAMD), 911 guests, and 9 spiders.
Key: Admin, Global Mod, Mod
Newest Members
rki, FranzIII, indonesiae, The_Judge, storrealba
18919 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Binary Options Test #459067
04/19/16 16:51
04/19/16 16:51
Joined: Apr 2016
Posts: 3
D
duncan90 Offline OP
Guest
duncan90  Offline OP
Guest
D

Joined: Apr 2016
Posts: 3
Hi guys! New here. I am trying to test a simple RSI strategy on Binary options in M5 TF but I think there is something wrong here.

Strategy is to buy/sell when RSI is higher/lower than overbought/oversold at the CLOSE of the m5 bar.
As I have programmed it elsewhere and it gave much different results.

function run()
{
StartDate = 2015;
EndDate = 2016;

BarPeriod = 5;

vars C0 = series(price());
vars RSI0 = series(RSI(C0, 14));
var Threshold = 70;
var Threshold2 = 30;
ExitTime = 5;

if(crossUnder(RSI0,Threshold2))
enterLong();
else if(crossOver(RSI0,Threshold))
enterShort();
}




Have a nice day!

Re: Binary Options Test [Re: duncan90] #459069
04/19/16 21:01
04/19/16 21:01
Joined: Jun 2013
Posts: 1,609
D
DdlV Offline
Serious User
DdlV  Offline
Serious User
D

Joined: Jun 2013
Posts: 1,609
Welcome duncan90! If you want Close, you'll need to use priceClose().

HTH.

Re: Binary Options Test [Re: DdlV] #459079
04/20/16 13:57
04/20/16 13:57
Joined: Apr 2016
Posts: 3
D
duncan90 Offline OP
Guest
duncan90  Offline OP
Guest
D

Joined: Apr 2016
Posts: 3
Thanks so much for pointing that out! Im glad to join this community.

I just realised that there is a binary flag that I can set to. Is this the right way to set a flag?

And also will optimize() work in Binary? Currently it does not work for me.



function run()
{
set(BINARY);
//WinPayout=0.8;
//Spread=0;
StartDate = 2015;
EndDate = 2016;

BarPeriod = 5;

// calculate the buy/sell signal
vars C0 = series(priceClose());
vars RSI0 = series(RSI(C0, 14));
var Threshold = optimize(70,70,80,1);
var Threshold2 =optimize(30,30,20,-1);
ExitTime = 2;

if(crossUnder(RSI0,Threshold2))
enterLong();
else if(crossOver(RSI0,Threshold))
enterShort();

}

Re: Binary Options Test [Re: duncan90] #459082
04/20/16 14:29
04/20/16 14:29
Joined: Jun 2013
Posts: 1,609
D
DdlV Offline
Serious User
DdlV  Offline
Serious User
D

Joined: Jun 2013
Posts: 1,609
Yes, that's how to set a flag. Look also at the PARAMETERS flag, and the workshop discussing optimization.

HTH.

Re: Binary Options Test [Re: DdlV] #459083
04/20/16 14:53
04/20/16 14:53
Joined: Apr 2016
Posts: 3
D
duncan90 Offline OP
Guest
duncan90  Offline OP
Guest
D

Joined: Apr 2016
Posts: 3
Appreciate your help man! I will definitely go through it again.

Re: Binary Options Test [Re: duncan90] #459086
04/21/16 10:55
04/21/16 10:55
Joined: Dec 2014
Posts: 202
Germany
Smon Offline
Member
Smon  Offline
Member

Joined: Dec 2014
Posts: 202
Germany
You need to set:


WinPayout = 80;
LossPayout = 0;


Moderated by  Petra 

Powered by UBB.threads™ PHP Forum Software 7.7.1