I have been working on a MACD strategy that involves 3 MACD time frames plotted in one pane (MACD A, MACD B and MACD C). I have gone as far as programming EL to plot the 3 MACD's in the same time frame and that's where my programming ability stops.
My intention is to create a strategy (or show me) that will generate a Buy/Sell (or show me signal) when certain events trigger.
When MACDDiff A < 0, Then plot a DOT (BEAR) on the current bar (and at bar close) WHEN MACDDiff B < 0 within 5 bars of MACDDiff A.
In other words when MACD A crosses Bear, any time MACD B crosses bear (on the same bar or the next five bars) plot a DOT (show me).
I would also like to be able to do the same with all 3 MACDs so that when all 3 cross in the same direction within 5 bars to plot a DOT (preferably in a separate pane and not on the price chart).
I would appreciate any help to guide me in the right direction.
Thanks ABCTG. The problem is, first and foremost, the programming lingo (plot DOT), and secondly, I need it to plot when MACD B crosses in the same direction as MACD A, BUT within 5 bars. For example, in a H1 TF any time MACD A and MACD B cross in the same direction within a 0-5 bar interval (5 hours), then plot a DOT WHEN MACD B crosses.
BTW, MACD A is the smaller parameter. For example, if MACD A = 12/26/9, MACD B = 24/52/9 and MACD C = 60/130/9.
Also, I need to mention that the crossing is actually the crossing of MACD and MACDAvg. I mentioned MACDDiff because it's the default signal of MACD indicator.
I would still suggest to start with the simple plot and then gradually make it more complex. For a dot you have to use the same reserved word i.e. PlotX, where X is the PlotNumber. Then you have to change the plot style in the indicator properties to point or cross.
You mentioned that you did not want the plot to be on the same chart as the price. Plot it in a second chart and plot the 1st macd at a value of 1. Then the second at 0, followed by the 3rd at -1. This the gives you three rows of potential dots on the bottom chart. When they are above each other, you have met your condition.
If you also specified the color in the plot, you could use green dots for longs and red dots for shorts.
Sent from my SM-N9005 using Tapatalk
The following user says Thank You to NW27 for this post:
Here's what I have so far and it is quite obvious that I am nowhere near where I want to be
As I mentioned earlier, my EL skills are very minimal and I have to refer to other indicators and ShowMe's to try and make something out of it. For instance, I don't know how to go about plotting ONE dot (currently plotting a DOT at each bar in a separate pane).
I am going to continue working on this and I would appreciate any feedback.
As you can see from my last post I am trying (and struggling) to get this right, but my knowledge of EL is too limited. I have to be honest and mention that I do not understand what you are referring to as MACD value.
you are using duplicate plot numbers in your code, for clarity you should remove the duplicates and also not plot the MACD and the High or Low in the same pane. This will mess up your scaling.
The conditions you used for checking like "MyMACD > MACDAvg " for example, will produce dots as long as they are valid i.e. for every bar where MyMACD is above MACDAvg. If you are looking for the cross over bars, you can either use the reserved word "MyMACD crosses over MACDAvg" or add the additional check that on the previous bar MyMACD was below MACDAvg. In Easylanguage you can reference values from previous bars by adding a square bracket to your variable. The number within the brackets is the number of bars you want to go back where 0 is the current bar.
I'd highly recommend studying the EasyLanguage Essentials pdf that you can download via the Tradestation website, this covers most of the basics.
You are absolutely right. The duplicate plot numbers were an error as I was trying different things, such as removing the actual MACD plots. Also thank you for the cross above and below tip. That fixed the issue with plotting dots at each bar.
I have downloaded the EL PDF and started reading it. In my defense I must say that it is overwhelming for an inexperienced programmer such as myself, but I do intend to learn the essentials.
As of now this is what I have so far.
As for the second part of the strategy I would appreciate if you could give me pointers on bar intervals so that MACD B and MACD C plot a DOT only when their crossings happen within 5 bars of MACD A crossing, otherwise NO DOTS.
I really appreciate your help. I feel I have accomplished more than I was hoping for and only in a few hours
you are welcome. I know that it is overwhelming at first, that's why I suggested to start simple. One way to accomplish what you have in mind is store the bar number with a variable when your MACD A crosses (use the reserved word CurrentBar) and compare it to the bar number at the moment your second MACD crosses. If the difference is within your allowed limits, the code can plot the dot.