Rajandran R Founder of Marketcalls and Co-Founder Algomojo. Full-Time Derivative Trader. Expert in Designing Trading Systems (Amibroker, Ninjatrader, Metatrader, Python, Pinescript). Trading the markets since 2006. Mentoring Traders on Trading System Designing, Market Profile, Orderflow and Trade Automation.

Rotation Factor – Amibroker AFL Code

40 sec read

Rotation Factor is a sentimental indicator used in Market Profile to Indicate who is control (Buyers/Sellers) in the market for the day. If the rotational factor prints positive values every day then it mean buyers are in control in the market. Negative Values indicates sellers are in control. Same principle can be applied to investing as well.

How Rotation Factor is Calculated?

1)Rotational Factors Starts with Zero on the first bar

2)In the next bar onwards the Rotational Factor is calculated as shown below

ConditionPoints
Current Bar makes High High and Higher Low+2 points
Current Bar makes Low High and Lower Low-2 Points
Current Bar makes Higher High and Lower Low0 Points
Current Bar makes Lower High and Higher Low0 Points
Curr High and Prev High is Equal and Higher Low+1 Points
Current Bar Makes Higher High but Curr and Pre lows are equal+1 Points
Current Bar Makes Lower High and Current and Prev Equal Lows-1 Points
Current Bar Makes Equal Curr and Prev High and Lower Lows-1 Points

So the rotation factor for each and every bar takes values ranging from +2 to -2. And During the day you should keep tracking of the running (cumulative) total of the rotation factors.

3)cumulatively Rotational Factor is calculated and plotted in 30min timeframe as shown below

Nifty Futures 30min

 
https://gist.github.com/c2b4d4aa41385f4bcc6a

Sample Principle Can be applied to Monthly Charts also. Here in this case Rotational Factors Starts with Zero on the first day of the month and varies cumulatively for each and every day.

RCOM Futures – EOD Charts
RCOM Futures

Download Rotational Factor AFL for Amibroker

Rajandran R Founder of Marketcalls and Co-Founder Algomojo. Full-Time Derivative Trader. Expert in Designing Trading Systems (Amibroker, Ninjatrader, Metatrader, Python, Pinescript). Trading the markets since 2006. Mentoring Traders on Trading System Designing, Market Profile, Orderflow and Trade Automation.

Angel Broking Multi-Client Amibroker Trading Module

Got frequent requirements from Angel Broking Customers to automate Amibroker based trading system where one single generation from charts could punch orders in multiple...
Rajandran R
6 min read

Option Button Trading to Trade ATM, ITM, OTM Options…

Here is a simple button trading module which can be used to send option trading order with buttons. Users can configure the button to...
Rajandran R
7 min read

10 Things to know before learning/trading with Market Profile

Market Profile a great tool to understand the markets, market sentiments, helps traders to understand the dominant traders, weaker hand traders much better than...
Rajandran R
2 min read

34 Replies to “Rotation Factor – Amibroker AFL Code”

  1. hello

    really good idea. but it doesn’t incorporate spread ( high – low ) and or volume in the above equation .

    either spread may be incorporated or diff in consecutive closes may also be incorporated.

    also the process of starting every month afresh doesnt seem logical instead ( for eod only ) a better idea would
    to specify no of bars like 220 ( for longer term ) and 70 for medium term . and 20 for shorter term in that way the above may be more logical .

    rgds

    amit

    1. Rotation Factor is a concept in Market Profile. You can bend it with your own market experience. There are no rules here!

    1. For the current bar it is always recommended to check after bar closing. However it doesn’t repaints for previous bars.

    2. You can convert the code the non repainting by modifying the code on line no 69 as

      Plot(ref(RF,-1),”Rotational Factor”, IIf(RF>0,colorGreen,colorRed),styleHistogram | stylethick);

  2. Hi, Can you please share any websites where we can view live NSE futures both Index and stock futures charts with technical indicators to analyse? I saw the futures charts in your site as well but there is no option to add technical indicators here and that is why I ask you to refer some other sites as well. Thanks

      1. Thank you. are the charts in the above mentioned link are live or delayed? if delayed then howmuch delay?

  3. hi, Sorry, you can ignore my previous comment except “Thank you” Because you had already mentioned in your comment that as “… live charts..” I noted it now. Thanks again

      1. Hi Thank you.
        Could you please guide on creating an afl to scan/explore and plot trendlines and trendline breakout in closing price. It would be of great help if you could guide me on that

  4. Hi Mr.Rajendran,

    Iam new to tradin. I have gone through your articles its awsome.Could you please tell me what minute we have to follow in order to understand the Rotational Factor. And if its +2 can we buy from the second candle or vice versa. Could you please give me a reply on this.
    Thank You,

    Manoj George

        1. Hi I am not able to view Nifty option contracts and stock option contracts. I followed the instructions provided in the charts page but nifty and stock option contracts are not displayed. Please help me in getting the option contract charts. Thanks

          1. You can get the Nifty Options and Stock Option Contacts here live marketcalls.in/charts
            we are not providing EOD charts at this point.

          2. Hi,
            Nifty options contract symbols are not available. You may please check it.

            NIFTY15FEB8500CE- This is the format that is suggested in that charts page. But No Nifty options contracts are there. Check for NIFTY15JUL8300CE contract and let me know if you can find it. Or correct me if I am wrong. Thanks in advance

          3. Dear Rajendran, That is how I tried. I am not able to fine the Nifty options charts. If you want I can share the screen shot. I dont know why it is not displaying it for me. Could you please check it again as normal user instead of admin.
            I really wonder why it is not displaying it for me.

          4. Hi,
            It is working now. Thanks.
            I need your guidance on something.
            Say based on my analysis I feel if Nifty breakouts @ 8500 it might hit 8600 So here my entry point is 8500 and exit/target is 8600. How to convert this in to option contracts for various strike prices? Hope you get my point.
            (This is just an example)

          5. Hi Rajendran,
            I have a small doubt in Options Open interest. How to find out howmany number of Longs are in place, howmany number of shorts in place and howmany contracts have been transfered from old buyer/seller to new seller/buyer , by looking at the OI and volume? Is it possible to find out? if so please share how?
            Thanks

          6. Hi Yeah I have seen that. It doesnt have information about shorts covered and longs closed

  5. I need your guidance on something.
    Say based on my analysis I feel if Nifty breakouts @ 8500 it might hit 8600 So here my entry point is 8500 and exit/target is 8600. How to convert this in to option contracts for various strike prices? Hope you get my point.
    (This is just an example)

  6. Hi Rajendran,
    Where can we get historical Option contract charts with technical indicators? both lower time like 5 min 30 min and daily, weekly chart. Please through some light. Thanks

  7. Hi Could you please explain about “Long unwinding” with an example. I read about this in internet but I could not find the the meaning of “unwinding” in “Long unwinding” definition. It would be great if you could explain about Long unwinding

    Regards

  8. Sir.. Can you please share the AFL for calculating yday POC and day before yday POC? . Tks for your help

  9. hi.sir. i like your ROTATIONAL FACTOR idea very much. it is really very good and dont need any other market study or chart study. it is depend on live rate not on trend. i like it very much. thank you much for giving such idea.

Leave a Reply

Get Notifications, Alerts on Market Updates, Trading Tools, Automation & More