Absolute Strength oscillator mt4

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #119777 quote
    Patrick K Templar
    Participant
    Average

    Hello could you convert this ASO (absolute Strength oscillator) mt4 to prorealtime it’s similar to Ash indicator but it’s not the same

    #property indicator_separate_window
    #property indicator_buffers 6
    #property indicator_color1 Green
    #property indicator_color2 Red
    
    extern string ModeStr="Mode: 0 - RSI, 1 - Stoch";
    extern int Mode=0;  // 0 - RSI, 1 - Stoch
    extern int Length=9;
    extern int Smooth_Length=2;
    extern int Price=0;    // Applied price
                           // 0 - Close
                           // 1 - Open
                           // 2 - High
                           // 3 - Low
                           // 4 - Median
                           // 5 - Typical
                           // 6 - Weighted  
    extern int Method=0;  // 0 - SMA
                          // 1 - EMA
                          // 2 - SMMA
                          // 3 - LWMA
    
    
    double BullsOut[], BearsOut[];
    double Bulls[], Bears[], AvgBulls[], AvgBears[];
    
    int init()
    {
     IndicatorShortName("Absolute Strength oscillator");
     IndicatorDigits(Digits);
     SetIndexStyle(0,DRAW_LINE);
     SetIndexBuffer(0,BullsOut);
     SetIndexStyle(1,DRAW_LINE);
     SetIndexBuffer(1,BearsOut);
     SetIndexStyle(2,DRAW_NONE);
     SetIndexBuffer(2,Bulls);
     SetIndexStyle(3,DRAW_NONE);
     SetIndexBuffer(3,Bears);
     SetIndexStyle(4,DRAW_NONE);
     SetIndexBuffer(4,AvgBulls);
     SetIndexStyle(5,DRAW_NONE);
     SetIndexBuffer(5,AvgBears);
    
     return(0);
    }
    
    int deinit()
    {
    
     return(0);
    }
    
    int start()
    {
     if(Bars<=3) return(0);
     int ExtCountedBars=IndicatorCounted();
     if (ExtCountedBars<0) return(-1);
     int limit=Bars-2;
     if(ExtCountedBars>2) limit=Bars-ExtCountedBars-1;
     int pos;
     double Pr0, Pr1;
     double smax, smin;
     pos=limit;
     while(pos>=0)
     {
      Pr0=iMA(NULL, 0, 1, 0, MODE_SMA, Price, pos);
      Pr1=iMA(NULL, 0, 1, 0, MODE_SMA, Price, pos+1);
      
      if (Mode==0)
      {
       Bulls[pos]=0.5*MathAbs(Pr0-Pr1)+Pr0-Pr1;
       Bears[pos]=0.5*MathAbs(Pr0-Pr1)-Pr0+Pr1;
      }
      else
      {
       smax=High[iHighest(NULL, 0, MODE_HIGH, Length, pos)];
       smin=Low[iLowest(NULL, 0, MODE_LOW, Length, pos)];
       Bulls[pos]=Pr0-smin;
       Bears[pos]=smax-Pr0;
      }
    
      pos--;
     } 
     
     pos=limit;
     while(pos>=0)
     {
      AvgBulls[pos]=iMAOnArray(Bulls, 0, Length, 0, Method, pos);
      AvgBears[pos]=iMAOnArray(Bears, 0, Length, 0, Method, pos);
    
      pos--;
     }
     
     double SmoothBulls, SmoothBears;
     pos=limit;
     while(pos>=0)
     {
      SmoothBulls=iMAOnArray(AvgBulls, 0, Smooth_Length, 0, Method, pos);
      SmoothBears=iMAOnArray(AvgBears, 0, Smooth_Length, 0, Method, pos);
      
      BullsOut[pos]=SmoothBulls/Point;
      BearsOut[pos]=SmoothBears/Point;
    
      pos--;
     }  
       
     return(0);
    }
    
    
    #119786 quote
    Vonasi
    Moderator
    Master

    As per your other request follow the instructions found here when requesting a free conversion:

    https://www.prorealcode.com/free-code-conversion/

     

    The person doing the conversion needs far more than just the code to assist them. Please add the missing information to this post rather than submitting it again via the form.
    How to formulate the request?
      • Write a meaningful title, containing the name of the original code and its platform

    e.g. “Conversion of indicator X from the Y trading software”

      • Add a complete description and any useful information about the original code
      • Add the original code in your description or as an attachment
      • Add attachments files: screenshots, documents, code files, ..

    (if the original code is an indicator, screenshots are greatly appreciated!)

    #119807 quote
    Patrick K Templar
    Participant
    Average

    Absolute Strength oscillator mt4 Hello could you convert this ASO (absolute Strength oscillator) mt4 to prorealtime it’s similar to absolute Strength indicator but it’s not the same I don’t have any more information than this hope there’s enough the indicator is also called ash but it’s filename is absolute strength oscillator thank you

    ash.png ash.png
    #119818 quote
    Nicolas
    Keymaster
    Master

    Absolute Strength indicator can be found here: Absolute Strength

    It’s always a good idea, before asking code conversion, to make a search on the website/library! 😉

    #119838 quote
    Patrick K Templar
    Participant
    Average

    I believe the equations are slightly different but it’s ok ok it’s not that much of a big deal thank you anyway

    Patrick

    #119841 quote
    Vonasi
    Moderator
    Master

    In what way are the calculations different? I’m no MT4 expert but there are not many calculations in that indicator and they all look the same to me. Are you sure that it isn’t because you have the settings different? Different average type or different smoothing length perhaps?

    #119884 quote
    Patrick K Templar
    Participant
    Average

    Hello Vonasi

    Thank you for looking just to let you know no I have played around with all the settings because the modes might not actually be in the same order that’s fine, it’s just a difference between the two  indicate on the mt4 platform and the one in the picture that called absolute strength oscillator on the left is really smooth it’s settings are basically the same as the indicator below which is called absolute strength histogram. It can get a bit confusing, I’ll try and get as close as I can with the pro real time absolute strength indicator but thank you anyway

    Patrick

    dif.png dif.png
    #119887 quote
    Vonasi
    Moderator
    Master

    Also bear in mind that the data you are applying the indicator to is not going to be the same.

    For example if you are using PRT with IG then they include Sunday candles where your MT4 data might not. If you don’t feed the same data in then you won’t get the same result out.

    Patrick K Templar thanked this post
    #119934 quote
    Nicolas
    Keymaster
    Master

    If you compare calculation made with different data, you will obviously not get the same results.

Viewing 9 posts - 1 through 9 (of 9 total)
  • You must be logged in to reply to this topic.

Absolute Strength oscillator mt4


ProBuilder: Indicators & Custom Tools

New Reply
Summary

This topic contains 8 replies,
has 3 voices, and was last updated by Nicolas
5 years, 12 months ago.

Topic Details
Forum: ProBuilder: Indicators & Custom Tools
Language: English
Started: 02/17/2020
Status: Active
Attachments: 2 files
Logo Logo
Loading...