New User code

Am new to Stock Charts. I have written a few strategies with Ami Broker, but would like to know how to write the following code
1- yesterday's low to be 3% below the yesterdays close, so a sell off
2-RSI(2) to have stayed below RSI(10) for 3 consecutive days

Also, is there a way to scan for Historical Volatility. So i would like the HV100 to be greater than 30 over the past year.

Thanks

Comments

  • markd
    markd mod
    edited July 2015
    Try this for the first part.

    [group is sp500]

    and [1 day ago low < 1 day ago close * 0.97]

    and [max(3, rsi(2)) < min(3,rsi(10))]

    I don't see a Historical Volatility indicator on the Technical Indicator drop down list on the advanced scan page. Maybe someone knows a good substitute?
  • Markd
    I wrote it in Ami Broker as
    HV= StDev(log(c/ref(c,-1)),100)*(252^.5)*100;
    And then write hv > 30 for example

    One more question. If i wanted the code for the RSI breaking above 10 after being under it for 3 days, how do i write that.

    Thanks for taking your time to answer these questions, not just mine, but all the others too. Appreciate it

    Jay
  • It appears the SC scan engine is not as sophisticated (but probably easier to learn for the non-programmer, I'm guessing).

    To check for the crossover, just move the "under" condition back a day.

    and [1 day ago max(3, rsi(2)) < 1 day ago min(3,rsi(10))]
    and [rsi(2) x rsi(10)]

    Thanks for the kind words. I learn from it, too. People have interesting ideas.