libCSS - .lmx Suffix Removal Code

User avatar
milanese
TechAdmin
Posts: 3293
Joined: Wed Jan 09, 2013 9:02 am
Location: btr rdx, r8 +

libCSS - .lmx Suffix Removal Code

Post by milanese »

theforexedge » Fri May 30, 2014 9:23 am wrote:Tommaso

Do you mean that there is an easier way of doing this?

I guess as my coding skills are quite limited and I used to use the CSS code from Steve's shell i've just cut and pasted the libCSS..

I was using the CSS weighing all the currency pairs, but I found that there are two conditions I wanted to make sure are happening:

1. There is s currency cross

2. Top or bottom reversal

and I found just weighing the symbols on the charts worked..

Anyway thinks for all your help.. :good:

Jason
As I told you just use TMA-slope add this to functions:

Code: Select all

//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
double GetSlope(string symbol,int tf,int shift)
  {
   double atr=iATR(symbol,tf,TMA_ATR_MA,shift+10)/10;
   double gadblSlope=0.0;
   if(atr!=0)
     {
      double dblTma = iMA( symbol, tf, 21, 0, MODE_LWMA, PRICE_CLOSE, shift);
      double dblPrev = ( iMA( symbol, tf, 21, 0, MODE_LWMA, PRICE_CLOSE, shift + 1 ) * 231 + iClose( symbol, tf, shift ) * 20 ) / 251;
      
      gadblSlope=(dblTma-dblPrev)/atr;
     }

   return ( gadblSlope );

  }
//+------------------------------------------------------------------+
//| calcTma()                                                        |
//+------------------------------------------------------------------+
double calcTma(string symbol,int tf,int shift)
  {
   double dblSum  = iClose(symbol, tf, shift) * 21;
   double dblSumw = 21;
   int jnx,knx;

   for(jnx=1,knx=20; jnx<=20; jnx++,knx--)
     {
      dblSum  += ( knx * iClose(symbol, tf, shift + jnx) );
      dblSumw += knx;

      if(jnx<=shift)
        {
         dblSum  += ( knx * iClose(symbol, tf, shift - jnx) );
         dblSumw += knx;
        }
     }

   return( dblSum / dblSumw );

  }
//+------------------------------------------------------------------+
You can call them in that way:

Code: Select all

TMASlopeVal[0]= GetSlope(Symbol(),TMASlopeTF,0);
   TMASlopeVal[1]= GetSlope(Symbol(),TMASlopeTF,m_bar+1);
   TMASlopeVal[2]= GetSlope(Symbol(),TMASlopeTF,m_bar+2);
Cheers :)

Tommaso
Global Prime is the official SHF broker :yahoo:
Searching for Servers and Workstations with individual configuration?
Just PM
:smile: Click here to go to the BoardKnowledgeBase
NOTE: Cookies and JavaScript are required for the using the board, with full functionality
User avatar
traderduke
Trader
Posts: 306
Joined: Mon Nov 28, 2011 7:30 pm
Location: East Coast USA

libCSS - .lmx Suffix Removal Code

Post by traderduke »

Tommaso
do you have a up to date TMASlope indicator with your code?
Ray
User avatar
milanese
TechAdmin
Posts: 3293
Joined: Wed Jan 09, 2013 9:02 am
Location: btr rdx, r8 +

libCSS - .lmx Suffix Removal Code

Post by milanese »

traderduke » Mon Jul 18, 2016 12:49 pm wrote:Tommaso
do you have a up to date TMASlope indicator with your code?
Ray
Hi Ray you can try the attached one, it is actualized for the latest builds..

Cheers :)

Tommaso
You do not have the required permissions to view the files attached to this post.
Global Prime is the official SHF broker :yahoo:
Searching for Servers and Workstations with individual configuration?
Just PM
:smile: Click here to go to the BoardKnowledgeBase
NOTE: Cookies and JavaScript are required for the using the board, with full functionality
Post Reply

Return to “Coders Hangout”