## Rotation Factor

Custom MT4 expert advisors published here.

### Rotation Factor

Original LUA oscillator: viewtopic.php?f=17&t=20592.

CRF.mq4
Alexander.Gettinger
FXCodeBase: Confirmed User

Posts: 3785
Joined: Wed Mar 31, 2010 9:40 pm
Location: Russia, Omsk

### Re: Rotation Factor

Hello dear friend, hope all is good.

Can you compile a new MT4 version of Rotation Factor based on the code below? thanks!

_SECTION_BEGIN("Rotation Factor - Market Profile");

RF = 0;
NewDay = day() != Ref(day(), -1);

for(i=1;i<BarCount;i++)
{
if(NewDay[i]==True)
{
BarsUp[i]=0;
BarsDown[i]=0;
RF[i] = 0;

}
//If Current Bar Makes HH and HL
if(H[i]>H[i-1] AND L[i]>L[i-1] AND !NewDay[i])
{
RF[i]=RF[i-1]+2;
}

//If Current Bar Makes LH and LL
if(H[i]<H[i-1] AND L[i]<L[i-1] AND !NewDay[i])
{
RF[i]=RF[i-1]-2;
}

//If Current Bar Makes HH and LL
if(H[i]>H[i-1] AND L[i]<L[i-1] AND !NewDay[i])
{
RF[i]=RF[i-1];
}

//If Current Bar Makes LH and HL
if(H[i]<H[i-1] AND L[i]>L[i-1] AND !NewDay[i])
{
RF[i]=RF[i-1];
}

if(H[i]==H[i-1] AND L[i]>L[i-1] AND !NewDay[i])
{
RF[i]=RF[i-1]+1;
}

if(H[i]>H[i-1] AND L[i]==L[i-1] AND !NewDay[i])
{
RF[i]=RF[i-1]+1;
}

if(H[i]<H[i-1] AND L[i]==L[i-1] AND !NewDay[i])
{
RF[i]=RF[i-1]-1;
}

if(H[i]==H[i-1] AND L[i]<L[i-1] AND !NewDay[i])
{
RF[i]=RF[i-1]-1;
}

}

Plot(0,"",colorred,styleline);
Plot(RF,"Rotational Factor", IIf(RF>0,colorGreen,colorRed),styleHistogram | stylethick);

_SECTION_END();
logicgate

Posts: 268
Joined: Tue Dec 11, 2018 7:54 am

### Re: Rotation Factor

Your request is added to the development list under Id Number 4422

Apprentice
FXCodeBase: Confirmed User

Posts: 22093
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia

### Re: Rotation Factor

CRF2.mq4
Alexander.Gettinger
FXCodeBase: Confirmed User

Posts: 3785
Joined: Wed Mar 31, 2010 9:40 pm
Location: Russia, Omsk

CRF2.mq4

Thanks brother!
logicgate