Gamestudio Links
Zorro Links
Newest Posts
FXCM => AVA Trade Plugin???
by Martin_HH. 11/23/26 20:38
No connection to MT4
by Martin_HH. 11/23/26 06:38
MinMax function on History t6 file
by LucasJoshua. 11/21/26 14:28
What are you working on?
by rayp. 11/20/26 18:10
contractUpdate() is filtering if >2 rows
by mistery. 11/09/26 12:06
New Zorro version 3.15
by jcl. 11/09/26 09:24
Removing outliers from files
by jcl. 11/04/26 10:30
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
0 registered members (), 14,921 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
EvanTJ, rht, MaliceTheMaker, Haitao_Ren, JimSimons
19250 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Slope function. how? #482866
04/09/21 02:36
04/09/21 02:36
Joined: Mar 2021
Posts: 35
Ocean county, Florida
NewtraderX Offline OP
Newbie
NewtraderX  Offline OP
Newbie

Joined: Mar 2021
Posts: 35
Ocean county, Florida
Hello all,

This sample code is from the manual, it works fine just as it is.

var HighsDn[10] = { 1,1,1,2,1,1,1,3,1,1 }; // mind the reverse order
var LowsUp[10] = { 1,1,1,0.7,1,1,1,0.5,1,1 };

function main()
{
printf("\nSlope dn %.3f",slope(PEAK,HighsDn,10));
printf("\nSlope up %.3f",slope(VALLEY,LowsUp,10));
plot("DPO", HighsDn[10], LINE, BLUE);
plot("DPOd", LowsUp[10], LINE, RED);
}


However, when I use slope function on price series instead of HighsDn or LowsUp I don't get any values.

Do you have a sample for using slope function with price series?

Such as below:


function run()
{
BarPeriod=5;
LookBack = 100;
StartDate = 20210103;
EndDate = 20210104;

var* Price = series(price());

vars MM2 = series(SMA(Price,20));

printf("\n+");

printf("\nPEAK %.3f",slope(PEAK,MM2,5));
printf("\nVALLEY %.3f",slope(VALLEY,MM2,5));
}

zorro image that is result of running my script is below:
https://prnt.sc/117scg1

Thank you.

Re: Slope function. how? [Re: NewtraderX] #482870
04/09/21 13:40
04/09/21 13:40
Joined: Mar 2021
Posts: 35
Ocean county, Florida
NewtraderX Offline OP
Newbie
NewtraderX  Offline OP
Newbie

Joined: Mar 2021
Posts: 35
Ocean county, Florida
Can anyone find the problem with my script?

Re: Slope function. how? [Re: NewtraderX] #482873
04/09/21 18:31
04/09/21 18:31
Joined: Mar 2021
Posts: 35
Ocean county, Florida
NewtraderX Offline OP
Newbie
NewtraderX  Offline OP
Newbie

Joined: Mar 2021
Posts: 35
Ocean county, Florida
I have no clue on how to get this to work.
Can you guys point me to some a direction?

Re: Slope function. how? [Re: NewtraderX] #482885
04/13/21 06:19
04/13/21 06:19
Joined: Jul 2000
Posts: 28,149
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 28,149
Frankfurt
Look at your printf call. The slope is the price movement per bar. Are 3 decimals enough?

Re: Slope function. how? [Re: jcl] #482901
04/15/21 00:58
04/15/21 00:58
Joined: Mar 2021
Posts: 35
Ocean county, Florida
NewtraderX Offline OP
Newbie
NewtraderX  Offline OP
Newbie

Joined: Mar 2021
Posts: 35
Ocean county, Florida
Originally Posted by jcl
Look at your printf call. The slope is the price movement per bar. Are 3 decimals enough?

Thank you sir.


Moderated by  Petra 

Powered by UBB.threads™ PHP Forum Software 7.7.1