Gamestudio Links
Zorro Links
Newest Posts
[MED] Import from FBX (2010) missing!!!
by USER0328. 09/03/26 18:03
Purchase A8 full licence version
by ukgamer. 08/30/26 14:27
ZorroGPT
by TipmyPip. 08/29/26 06:56
Retrieve optimize() variables order (edited)
by NorbertSz. 08/25/26 13:24
Max Number of Strategies in /Strategy folder
by Martin_HH. 08/17/26 07:54
Pause button for evaluation shell?
by AndrewAMD. 08/13/26 17:16
Sam Foster Sound | Experienced Game Composer for Hire
by titanicpiano14. 08/10/26 12:46
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
0 registered members (), 1,565 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
riggi89, shuhari, KD1990, Student_64151, Koti
19230 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Trend Lines #414271
12/28/12 04:35
12/28/12 04:35
Joined: Dec 2012
Posts: 14
P
Pipinator Offline OP
Newbie
Pipinator  Offline OP
Newbie
P

Joined: Dec 2012
Posts: 14
JCL

Does Zorro have any provision for trendlines?
Or do I have to do the old y=mx+b myself?

Pip

Re: Trend Lines [Re: Pipinator] #414280
12/28/12 09:01
12/28/12 09:01
Joined: Jul 2000
Posts: 28,133
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 28,133
Frankfurt
If you mean linear regression: You can either use the "polyfit" function, or the standard "LinearReg" indicators in the ta-lib.

Re: Trend Lines [Re: jcl] #414297
12/28/12 13:41
12/28/12 13:41
Joined: Dec 2012
Posts: 14
P
Pipinator Offline OP
Newbie
Pipinator  Offline OP
Newbie
P

Joined: Dec 2012
Posts: 14
What I am looking for is a way to generate a trend line array that I can compare a breakout against. So I'm thinking if I have two points I determined for a trend line priceHigh(5), priceHigh(2) I could feed the points in to

trendArray = TrendLine()
I could compare (and plot)

if (price > trendArray[0] && price > priceHigh{1))
enterLong();


I don't understand what Linearreg is returning. b+m*(TimePeroid-1) is that the next value?

How do I call it?
LinearReg(var* Data, int TimePeriod): var
var *Data = priceHigh[0..5];

nextTrendValue = LinearReg(Data,60);??

Thanks!

Pipinator
Edit --------------
I've tried the following:
var nextValue = LinearReg(priceHigh,5);
printf("nextValue: %2.4f, priceHigh:%2.4f\n",(double)nextValue, (double) priceHigh);

The log file shows values like:
nextValue: 991021190119434640000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.0000, priceHigh:4211680.0000Bar:150
nextValue: 991021190119434640000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.0000, priceHigh:4211680.0000Bar:151

Last edited by Pipinator; 12/28/12 14:20.
Re: Trend Lines [Re: Pipinator] #414317
12/28/12 17:55
12/28/12 17:55
Joined: Jul 2000
Posts: 28,133
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 28,133
Frankfurt
How to call a function is explained in the tutorial. The LinearReg function and most other TA functions are called in exactly the same way as the LowPass function in workshop 4. If you are not sure what an indicator does, plot a line from it - then it normally becomes clear.

However, you're right - the LinearReg function doesn't make much sense to me either. Better use the LinearRegSlope function, which calculates the m value, the projected price change per bar.

Re: Trend Lines [Re: jcl] #414319
12/28/12 18:27
12/28/12 18:27
Joined: Dec 2012
Posts: 14
P
Pipinator Offline OP
Newbie
Pipinator  Offline OP
Newbie
P

Joined: Dec 2012
Posts: 14
Jcl.. thanks I will try that. But solve the mystery of printf for me. I tried printing out price priceHigh values with %f and it is coming up 0's or when I cast it to double, as an overflow number. How do I get the values to print in the log?

Pipinator

Re: Trend Lines [Re: Pipinator] #414351
12/30/12 09:59
12/30/12 09:59
Joined: Apr 2008
Posts: 600
Austria
Petra Offline
Support
Petra  Offline
Support

Joined: Apr 2008
Posts: 600
Austria
printf("\nMy price is: %f",priceHigh());


Moderated by  Petra 

Gamestudio download | 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