| Coding Forum Collaborate, receive help, or discuss coding related issues. |
![]() | | Tweet | |
| | #1 | ||
![]() | Rotation Factor (Market Profile Code) I have a headache trying to fix it because it seems to have logic that is perfectly fine. Can someone take a look at this and figure out how to re-write it in a different way that might make it work? I am thinking there is something wrong with either the word 'summation' or with the 'length' code.... What its supposed to do is track 30-min bars relative to the one preceeding it and keep a 'running score' --- such that if a low goes below the previous low, that is -1 -- if the high makes a lower high, that is -1 for a total score of -2 for that bar. these are then summed for the intraday session since the beginning of the day (you don't score the first bar of day fyi). so a rotation factor of -4 would be a day where you have made 2 lower lows and 2 lower highs after the first THREE bars. inside bars (ie, high<high[1] AND low>low[2]) and outside bars are scored as a zero. again, this WAS working but no longer does so what I need is for the same content to work --- but somehow coded differently in the hopes that OEC will be able to read the re-worked code. thanks in advance: vars: aa(0), bb(0), cc(0), dd(0), ee(0), firstbar(0), length(0); if date>date[1] then begin firstbar=currentbar; end; length=(currentbar-firstbar); if h>h[1] then aa=1 else aa=0; if h<h[1] then bb=-1 else bb=0; if h=h[1] then cc=0; if l>l[1] then dd=1 else dd=0; if l<l[1] then ee=-1 else ee=0; if l=l[1] then cc=0; value1=aa+bb+cc+dd+ee; if date = date[1] then value2=summation(value1,l ength); if date = date[1] then begin plot1(value2,"count1"); end; plot2(0,"0"); | ||
| |
|
| | #2 | ||
![]() | Re: Rotation Factor (Market Profile Code) can you post the error message? The code compiled in MultiCharts. Here's the chart. Does it looks right? p.s. I have added the up/down color. Last edited by Tams; 04-20-2009 at 06:23 PM. | ||
| |
|
| | #3 | ||
![]() | Re: Rotation Factor (Market Profile Code) it compiles without an error -- it just gives the wrong indicator -- (small problem huh)... note how mine is wrong (look at the 4th bar in the indicator pane today) and yours is right using the same code.... this is why was just hoping for the same type of code but just re-worded in a diff't way --- I just don't know how to do it another way.... thanks for any help: | ||
| |
|
| | #4 | ||
![]() | Re: Rotation Factor (Market Profile Code) Code: vars: RotationFactor( 0 ); if CurrentBar > 1 then begin if Date <> Date[1] then RotationFactor = 0; if Date = Date[1] then begin if High > High[1] then RotationFactor = RotationFactor + 1; if High < High[1] then RotationFactor = RotationFactor - 1; if Low > Low[1] then RotationFactor = RotationFactor + 1; if Low < Low[1] then RotationFactor = RotationFactor - 1; end; end; Plot1(0,"ZeroLine"); Plot2(RotationFactor,"RF"); | ||
| |
|
| | #5 | ||
![]() | by the way, there wasn't a single +2 RF reading today Last edited by Frank; 04-20-2009 at 10:06 PM. | ||
| |
|
| | #6 | ||
![]() | Re: Rotation Factor (Market Profile Code) Code: //----------------------------------------------------- inputs: //---------------------------------------------------- up.color( blue ); //---------------------------------------------------- vars: //---------------------------------------------------- RF(0); if CurrentBar > 1 then begin if Date <> Date[1] then RF = 0; if Date = Date[1] then begin if High > High[1] then RF = RF + 1; if High < High[1] then RF = RF - 1; if Low > Low[1] then RF = RF + 1; if Low < Low[1] then RF = RF - 1; end; end; Plot1( 0 , "ZeroLine" ); Plot2( RF , "RF" ); if RF > RF[1] then SetPlotColor( 1 , up.color ); | ||
| |
|
| The Following User Says Thank You to aaa For This Useful Post: | ||
Tams (04-25-2009) | ||
![]() |
| Thread Tools | |
| Display Modes | Help Others By Rating This Thread |
| |
| ∧ Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Market Profile Easy Language Code | Kmlrt | Market Profile | 7 | 11-18-2008 12:22 AM |
| [Market Profile] Market profile / volume profile | jfutures | Technical Analysis | 2 | 10-10-2008 10:08 AM |
| Profile Trend March + Market Profile Momentum | spyro | Coding Forum | 12 | 10-04-2008 04:17 AM |
| Market Profile for YM | tony1d | E-mini Futures Trading Laboratory | 13 | 06-16-2007 11:33 AM |
| Market Profile POC | dupaski | Technical Analysis | 8 | 03-08-2007 12:05 AM |