PLEASE ASSIST ME IN CONVERTING THE CODE BELOW SO IT CAN BE USED IN WEALTH LAB PRO
#property indicator_separate_window
#property indicator_buffers 2
#property indicator_color1 LightGray
#property indicator_color2 DarkOrchid
#property indicator_width1 2
#property indicator_width2 2
//---- indicator buffers
extern int period = 240;
extern bool show_speed = TRUE;
int limit;
double speed[];
double acceleration[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
//---- indicators
IndicatorBuffers(2);
//---- drawing settings
if (show_speed == TRUE){
SetIndexStyle(0,DRAW_HISTOGRAM);
}else{
SetIndexStyle(0,DRAW_NONE);
}
SetIndexBuffer(0,speed);
SetIndexStyle(1,DRAW_LINE);
SetIndexBuffer(1,acceleration);
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()
{
int counted_bars=IndicatorCounted();
int i;
//----
if(counted_bars>0) counted_bars--;
limit=Bars-counted_bars;
for(i=0; i<limit; i++) {
speed[i] = iClose(Symbol(),0,i)-iClose(Symbol(),0,i+period);
}
for(i=0; i<limit; i++) {
acceleration[i] = speed[i]-speed[i+period];
}
//----
return(0);
}
//+------------------------------------------------------------------+
Size:
Color:
Did we already ask
twice in support portal to not use ALL CAPS? This creates an impression of shouting that nobody likes.
Appreciate your understanding that our resource is moderated for everyone's benefit and crossposting is prohibited. I had to delete
five more exactly duplicate threads titled with ALL CAPS under each forum category. Next time deleted will be
all the posts.
Now to your indicator - someone else's copyrighted MQL4 work. There is no need to remove author's copyright notice from the
original version because every skipped information might help us understand that unnamed something coming from the different platform:
//+——————————————————————+
//| price speed and acceleration.mq4 |
//| Copyright © 2011, Andrea Salvatore |
//| http://www.pimpmyea.com |
//+——————————————————————+
#property copyright “Copyright © 2011, Andrea Salvatore”
#property link “http://www.pimpmyea.com”
Hopefully this is close to what you're looking for:
CODE:
Please log in to see this code.
Size:
Color:
thank you eugene
Size:
Color:
In an duplicate thread, WEALTHPRO25 wrote:
dear eugene,
i want to thank you for your help, the code works
is it possible to add one more derivative, meaning the change in acceleration representated as a line, which is called jerk in math terminology, can you please add this to the code you wrote previously, i want to thank you again for your help. sorry for writing in cap lock previously.
Size:
Color:
Added the rate of change of acceleration. You can define its period separately and interactively through the Strategy Parameters box on the bottom left:
CODE:
Please log in to see this code.
Let me know if something does not meet your expectations.
Size:
Color:
thank you very much eugene,
just one more request, is it possible to plot a line which is the rate of change of jerk, called the snap in math terminology, can you please add this to the last code you wrote. greatly appreciate your assistance.
Size:
Color:
Here you go:
CODE:
Please log in to see this code.
Size:
Color: