Gamestudio Links
Zorro Links
Newest Posts
Zorro Trader GPT
by TipmyPip. 03/06/24 09:27
VSCode instead of SED
by 3run. 03/01/24 19:06
Deeplearning Script
by wolfi. 02/26/24 12:46
Sam Foster Sound | Experienced Game Composer for Hire
by titanicpiano14. 02/22/24 16:22
AssetAdd() vs. modern asset list?
by jcl. 02/21/24 15:01
How many still using A8
by Aku_Aku. 02/20/24 12:18
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (Quad, AndrewAMD), 567 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
sakolin, rajesh7827, juergen_wue, NITRO_FOREVER, jack0roses
19043 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: 27,977
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,977
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