Announcement

Collapse
No announcement yet.

Indicator showing new price range entry

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Indicator showing new price range entry

    Hi, I am looking for an indicator which shows me if the market moves into a new price range.
    F.e. If the market moves 5 points away from the start level (so 5 points higher or lower) the indicator value should show one time the value 1. Thereafter it should go back to value 0 and stay there. As soon then market moves again 5 points up or down from the new start level.
    Any help on or a efs example would be much appreciated.

  • #2
    mkinfosys
    The enclosed script should do it. You can change the value of Step in Edit Studies
    Alex

    PHP Code:
    function preMain(){
        
    setStudyTitle("Bit");
        
    setShowCursorLabel(false);
    }

    var 
    Price null;
    var 
    Price1 null;
    var 
    Bit 0;

    function 
    main(Step){

        if(
    Price == nullPrice close(0);
        if(
    Step == nullStep 5;

        if(
    getBarState()==BARSTATE_NEWBAR){
            
    Price1 Price;
        }
        
        if(
    close(0) >= Price1+Step || close(0) <= Price1-Step){
            
    Bit 1;
            
    Price close(0);
        } else {
            
    Bit 0;
        }

        return 
    Bit;

    Comment

    Working...
    X