[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Simple code help...



PureBytes Links

Trading Reference Links

Attached is a chart example of what I am trying to get, which hopefully
explains it a little more.

It seems like once a bar makes a higher high then the previously stored
highest(high,x), two things would maybe need to happen:
1. Reset the counter to 0
2. Tell the code to start counting UNTIL the high is taken out again.

Then, once this new highest(high,x)[1] is taken out AGAIN, it needs to
somehow know that it was Y bars ago that the highest(high,x)[1]
occurred.

Am I making any sense? :)

Thanks!
Cody

 

-----Original Message-----
From: Steve Guiot [mailto:guiot@xxxxxxx] 
Sent: Wednesday, December 10, 2003 3:25 AM
To: cburgat@xxxxxxxxxxxxxx; omega-list@xxxxxxxxxx
Subject: Re: Simple code help...

Sounds simple but isn't really that simple.



This code will store the value equal to the number of bars ago a
pivothigh
with a strength of input -"swingstrength" is initially broken,  looking
back
(input -"lookback") number of bars. I threw in a plot to help visualize.



{BarsToBreakPivHigh Indicator}



Inputs:

 LookBack(100),

 swingstrength(10);



Var: 

 BarsAgo(0),  

 counter(0);



counter = 1;

while counter <= lookback begin

    if PivotHighVSBar(1, H, SwingStrength, SwingStrength, Lookback)[1] =
counter and 

         H > PivotHighVS(1, H, SwingStrength, SwingStrength,
Lookback)[1]
and

         Highest(H, counter)[1] <= PivotHighVS(1, H, SwingStrength,
SwingStrength, Lookback)[1] then

     begin

          barsago = counter;

          counter = lookback + 1;

     end else 

     begin

          barsago = barsago[1];

          counter = counter + 1;

     end;

end;



plot1(barsago,"barsago");









 

-------Original Message-------

 

From: Cody Burgat

Date: Wednesday, December 10, 2003 2:45:37 AM

To: omega-list@xxxxxxxxxx

Subject: Simple code help...

 

Not sure if I've lost my mind or what, but I can't seem to figure out

the best way to do this:

 

1. Once price penetrates the highest(high,x)[1] 

2. I'd like to look at the bar that initially created the above

referenced: highest(high,x)[1]

3. and store how many bars ago it occurred as a variable. 

 

SO, if a new swing high is made and 10 bars later this high is

penetrated, I would like to have the BARSAGO variable read as 10 to

later use in my code. Obviously, if it was penetrated 4 bars later it

would be 4, and so on. I hope I'm being clear enough. 

 

Surely, I'm making this harder than it is. Can someone help me out here

so I can stop my brain from frying?!!

 

Thanks,

Cody 

 

. 

Attachment:
steve.png

Attachment: Description: "Description: PNG image"