Welcome Guest, please sign in to participate in a discussion. Search | Active Topics |

creating indicator in SF Rate this Topic:
Previous Topic · Next Topic Watch this topic · Print this topic ·
gunnels
Posted : Sunday, December 28, 2008 8:45:40 PM
Registered User
Joined: 12/16/2004
Posts: 14
I have ask this before but have never received a real answer.  have tried numerous times to create a simple indicator in SF. in real code i am using the following code: Plot = ((price.maxlow(1)+price.maxlow(2)+price.maxlow(3))/3)......to plot the average max low for last three bars, not including current bar.  I have no idea how it is calculaing the plot, but it generally plots the low of the current bar on the last 2 plots and something different for other plots.  have used the SF reset numerous times, to no avail.  Could someone PLEASE tell me what I am doing wrong.

dg
Julia_O
Posted : Sunday, December 28, 2008 9:28:48 PM


Worden Trainer

Joined: 4/26/2007
Posts: 508
gunnels,

Is the value you're wanting to plot really the average lowest low price value of each of the last three bars not including today?  I think the problem you're running into is using maxlow instead of just low if that's the case.

Let us know,
Julia
gunnels
Posted : Monday, December 29, 2008 7:32:33 PM
Registered User
Joined: 12/16/2004
Posts: 14

I tried using low at first but the results are the same.  I am simply trying to plot the average low of the previous 3 bars.  Again, the plot shown is todays low on the current bar, the days low on the previous bar, and some number, I dont know how it comes uup with it on the 3rd bar.

i dont think i am writing the code wrong, it's not that hard, but something isnt working right.

Help.

Julia_O
Posted : Tuesday, December 30, 2008 1:54:15 PM


Worden Trainer

Joined: 4/26/2007
Posts: 508
gunnels,

Try this:

plot =( price.low(1) + price.low(2) + price.low(3)) / 3

That should take care of it.  To unravel the mystery - when you use maxlow(3) for instance that returns the value of the lowest low over the past three bars.  That's not what you want - what you want is to take an average of three individual bars.

Hope that helps -
Julia
gunnels
Posted : Tuesday, December 30, 2008 9:08:51 PM
Registered User
Joined: 12/16/2004
Posts: 14
Julia,
i used the low as you suggested.  This time it worked, but orginally i was using the low, i got the same incorrect answer.  i dont understand what is going on, but something is, as It may well work now but not tomorrow! I know this sounds crazy, but that is whats happening
Julia_O
Posted : Tuesday, December 30, 2008 9:55:53 PM


Worden Trainer

Joined: 4/26/2007
Posts: 508
gunnels,

Glad to hear it worked this time - we're here if for some reason it stops.  Keep us posted.  If there's something systematically wrong, this is a great place to report it.   

Best,
Julia
Users browsing this topic
Guest-1

Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.