Gamestudio Links
Zorro Links
Newest Posts
Accessing All Historical Price Data
by JohnJits. 10/22/19 22:37
file_write var array ?
by laz. 10/22/19 16:00
SAV_STATS
by MatPed. 10/22/19 13:57
Instrument Price Zorro Chart
by jcl. 10/22/19 10:39
Calculating with price series
by AndrewAMD. 10/21/19 14:31
Error E355: Startup failure
by Dooley. 10/21/19 06:47
Today real live account blown - my experience
by Clifford_B. 10/19/19 17:09
AUM Magazine
Latest Screens
The Space Between
Pogostuck: Rage With Your Friends
Worst Case Z
AckCon'18 - Lotter vs the World 2 - Preview Release
Who's Online Now
4 registered members (JohnJits, AndrewAMD, Clifford_B, 1 invisible), 627 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
VillageTalkies, line7, Shutch, Clifford_B, Paulius
18310 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Switching from MQL4 #478124
09/10/19 19:33
09/10/19 19:33
Joined: Sep 2019
Posts: 5
Kalahari Desert, ZA
Fred7 Offline OP
Newbie
Fred7  Offline OP
Newbie

Joined: Sep 2019
Posts: 5
Kalahari Desert, ZA
Hi guys, I come from an MQL4 background and just trying to figure out or get my head around this coding. To learn I'm trying to stay on indi's that I understand and once I get the flow will move to the better stuff. (Yes, I did do all the lectures, and trying to sift through the HELP)

How will I do the following?

I thought it'll be something like this.

Code
function RSi_1hour()
{
	TimeFrame = 4;
	vars Close = series(priceClose());
	vars rsi60 = series(RSI(Close,12));
	return rsi60;
}


function run()
{
  set(PLOTNOW);
  BarPeriod = 15;
  MaxBars = 500;
  LookBack = 250;
  asset("EUR/USD"); // dummy asset
  PlotWidth = 800;
  PlotHeight1 = 400;
  
  vars Price = series(price());
  vars Close = series(priceClose());
  vars RSI12 = series(RSI(Close,12));
  vars rsiHTF = series(RSi_1hour());
  
  plot("RSI",RSI12,NEW,RED);
  plot("rsiHTF",rsiHTF,NEW,GREEN);

}


Q1. I'd like to display both TF's for RSI on a M15 chart.
Q2. If I comment out the two "rsiHTF"'s run this the M15 RSI shows normal, but uncomment those two lines and it is staggered and the H1 RSI is only straight line.

Help appreciated.

Last edited by Fred7; 09/10/19 20:28.
Re: Switching from MQL4 [Re: Fred7] #478129
09/11/19 11:32
09/11/19 11:32
Joined: Jul 2000
Posts: 27,033
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,033
Frankfurt
Your function returned a pointer instead of a variable.

var RSi_1hour()
{
TimeFrame = 4;
vars Close = series(priceClose());
return RSI(Close,12);
}

Re: Switching from MQL4 [Re: jcl] #478132
09/11/19 15:19
09/11/19 15:19
Joined: Sep 2019
Posts: 5
Kalahari Desert, ZA
Fred7 Offline OP
Newbie
Fred7  Offline OP
Newbie

Joined: Sep 2019
Posts: 5
Kalahari Desert, ZA
Thanx


Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1