Jump to content

Welcome to the new Traders Laboratory! Please bear with us as we finish the migration over the next few days. If you find any issues, want to leave feedback, get in touch with us, or offer suggestions please post to the Support forum here.

  • Welcome Guests

    Welcome. You are currently viewing the forum as a guest which does not give you access to all the great features at Traders Laboratory such as interacting with members, access to all forums, downloading attachments, and eligibility to win free giveaways. Registration is fast, simple and absolutely free. Create a FREE Traders Laboratory account here.

9146894me

Show Me Help

Recommended Posts

Can anyone help?

I would like a showme study to plot above and below the bar that crosses a moving average. Only on the first close above or below on each occurance. For up the upperline and for down the lower line.

 

_________________________________

 

Inputs: Length(100), TrigAvg(20), UpColor(Green), DnColor(Magenta);

 

 

Variables: back(0), xAvg(0);

 

 

PLOT1 (TimeSeriesForecast (Length, 0), "Trigger") ;

xAvg = XAverage (PLOT1, TrigAvg) ;

PLOT2 (xAvg, "AverageTSF") ;

IF (PLOT2 >= PLOT1) THEN

BEGIN

SETPLOTCOLOR (1, DnColor) ;

SETPLOTCOLOR (2, DnColor) ;

END ELSE

BEGIN

SETPLOTCOLOR (1, UpColor) ;

SETPLOTCOLOR (2, UpColor) ;

END ;

Share this post


Link to post
Share on other sites

Use PaintBar instead of ShowMe

 

Example code:

 

 

[size="2"][font="Arial"]
Input: Length(100);  
Input: TrigAvg(20);
Input: UpColor(Green);
Input: DnColor(Magenta);	


Var: back(0);
Var: xAvg(0);
Var: xTime(0);


xAvg  = XAverage (xTime, TrigAvg) ;
xTime = TimeSeriesForecast (Length, 0);


If close crosses above xAvg then PlotPaintBar( High, Low, Open, Close, "Cross", UpColor , 0, 2 ) ;

If close crosses below xAvg then PlotPaintBar( High, Low, Open, Close, "Cross", DnColor , 0, 2 ) ;
[/font][/size]

Share this post


Link to post
Share on other sites

Thanks for the Paintbar help. I plotted it and see it needs a little cleaning up. I added comments to 2 pictures and hopfully hte visual will help. I have lines crossing. I would like a paint bar to plot when there is a close Above the upper line which ever line that may be since they cross each other at times and NOT plot again until there is a close below the lower line and a paintbar plot.

Thanks

5aa70ff606968_Crossavgplot.thumb.jpg.db4eeda9c9bab0c07f9b69cb1b5373e1.jpg

5aa70ff60d448_AVGcrossplot2.thumb.jpg.49e3bcc495ab1d630b989f91831a358f.jpg

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.