MACD Strategy HELP! - futures io
futures io



MACD Strategy HELP!


Discussion in TradeStation

Updated
      Top Posters
    1. looks_one Saraf64 with 11 posts (0 thanks)
    2. looks_two ABCTG with 8 posts (1 thanks)
    3. looks_3 ezrollin with 2 posts (0 thanks)
    4. looks_4 NW27 with 1 posts (1 thanks)
    1. trending_up 7,122 views
    2. thumb_up 3 thanks given
    3. group 5 followers
    1. forum 22 posts
    2. attach_file 1 attachments




Welcome to futures io: the largest futures trading community on the planet, with well over 125,000 members
  • Genuine reviews from real traders, not fake reviews from stealth vendors
  • Quality education from leading professional traders
  • We are a friendly, helpful, and positive community
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts
  • We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community.  It's free and simple.

-- Big Mike, Site Administrator

(If you already have an account, login at the top of the page)

 
Search this Thread
 

MACD Strategy HELP!

(login for full post details)
  #1 (permalink)
Saraf64
Los Angeles, CA, USA
 
 
Posts: 14 since Mar 2014
Thanks: 3 given, 0 received

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.

 
Code
inputs: FastLength( Value ), SlowLength( Value), MACDLength( Value) ;
variables: MyMACD( 0 ), MACDAvg( 0 ), MACDDiff( 0 ) ;

MyMACD = MACD( Close, FastLength, SlowLength ) ;
MACDAvg = XAverage( MyMACD, MACDLength ) ;
MACDDiff = MyMACD - MACDAvg ;

Plot1( MyMACD, "MACD" ) ;
Plot2( MACDAvg, "MACDAvg" ) ;
Plot3( MACDDiff, "MACDDiff" ) ;

	
inputs: FastLength2( Value), SlowLength2( Value), MACDLength2( Value) ;
variables: MyMACD2( 0 ), MACDAvg2( 0 ), MACDDiff2( 0 ) ;

MyMACD2 = MACD( Close, FastLength2, SlowLength2 ) ;
MACDAvg2 = XAverage( MyMACD2, MACDLength2 ) ;
MACDDiff2 = MyMACD2 - MACDAvg2 ;

Plot4( MyMACD2, "MACD" ) ;
Plot5( MACDAvg2, "MACDAvg" ) ;
Plot6( MACDDiff2, "MACDDiff" ) ;

inputs: FastLength3( Value), SlowLength3( Value), MACDLength3( Value) ;
variables: MyMACD3( 0 ), MACDAvg3( 0 ), MACDDiff3( 0 ) ;

MyMACD3 = MACD( Close, FastLength3, SlowLength3 ) ;
MACDAvg3 = XAverage( MyMACD3, MACDLength3 ) ;
MACDDiff3 = MyMACD3 - MACDAvg3 ;

Plot7( MyMACD3, "MACD" ) ;
Plot8( MACDAvg3, "MACDAvg" ) ;
Plot9( MACDDiff3, "MACDDiff" ) ;
Plot10( 0, "ZeroLine" ) ;
My intention is to create a strategy (or show me) that will generate a Buy/Sell (or show me signal) when certain events trigger.

For Example:
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

Reply With Quote

Journal Challenge April 2021 results (now extended!):
Competing for $1800 in prizes from Jigsaw
looks_oneMaking a Living with the Microsby sstheo
(139 thanks from 20 posts)
looks_twoSalao's Journalby Salao
(45 thanks from 9 posts)
looks_3Deetee’s DAX Trading Journal (time based)by Deetee
(34 thanks from 15 posts)
looks_4Learning to Profit - A journey in algorithms and optionsby Syntax
(15 thanks from 12 posts)
looks_5Maybe a little bit different journalby Malykubo
(14 thanks from 13 posts)
 
Best Threads (Most Thanked)
in the last 7 days on futures io
Would You Sell Your System?
79 thanks
Big Mike in Ecuador
75 thanks
The Crude Dude Oil Trading System
64 thanks
The New Micro Contract - MICRO BITCOIN coming May 2021
25 thanks
futures io site changelog and issues/problem reporting
22 thanks
 
(login for full post details)
  #2 (permalink)
 ABCTG   is a Vendor
 
 
Posts: 2,238 since Apr 2013
Thanks: 417 given, 1,489 received

Saraf64,

what exactly seems to be the problem? Start with "When MACDDiff A < 0, Then plot a DOT (BEAR) on the current bar (and at bar close)" and post any issues back here.

Regards,
ABCTG

Follow me on Twitter Reply With Quote
The following user says Thank You to ABCTG for this post:
 
(login for full post details)
  #3 (permalink)
Saraf64
Los Angeles, CA, USA
 
 
Posts: 14 since Mar 2014
Thanks: 3 given, 0 received



ABCTG View Post
Saraf64,

what exactly seems to be the problem? Start with "When MACDDiff A < 0, Then plot a DOT (BEAR) on the current bar (and at bar close)" and post any issues back here.

Regards,
ABCTG

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.

Thanks again

Reply With Quote
 
(login for full post details)
  #4 (permalink)
 ABCTG   is a Vendor
 
 
Posts: 2,238 since Apr 2013
Thanks: 417 given, 1,489 received

Saraf64,

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.

Regards,
ABCTG


Saraf64 View Post
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.

Thanks again


Follow me on Twitter Reply With Quote
 
(login for full post details)
  #5 (permalink)
 NW27 
Newcastle, Australia
 
Experience: Intermediate
Platform: Multicharts 8 - Full Version
Broker: IB
Trading: SPI,FTSE100, 6E, 6A
 
Posts: 285 since Oct 2010
Thanks: 108 given, 186 received

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

Reply With Quote
The following user says Thank You to NW27 for this post:
 
(login for full post details)
  #6 (permalink)
Saraf64
Los Angeles, CA, USA
 
 
Posts: 14 since Mar 2014
Thanks: 3 given, 0 received


ABCTG View Post
Saraf64,

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.

Regards,
ABCTG

ABC,

Here's what I have so far and it is quite obvious that I am nowhere near where I want to be

 
Code
inputs: FastLength( 12 ), SlowLength( 26 ), MACDLength( 9 ) ;
variables: MyMACD( 0 ), MACDAvg( 0 ), MACDDiff( 0 ) ;

MyMACD = MACD( Close, FastLength, SlowLength ) ;
MACDAvg = XAverage( MyMACD, MACDLength ) ;
MACDDiff = MyMACD - MACDAvg ;

Plot1( MyMACD, "MACD" ) ;
Plot2( MACDAvg, "MACDAvg" ) ;
Plot3( MACDDiff, "MACDDiff" ) ;

	
inputs: FastLength2( 26 ), SlowLength2( 52 ), MACDLength2( 9 ) ;
variables: MyMACD2( 0 ), MACDAvg2( 0 ), MACDDiff2( 0 ) ;

MyMACD2 = MACD( Close, FastLength2, SlowLength2 ) ;
MACDAvg2 = XAverage( MyMACD2, MACDLength2 ) ;
MACDDiff2 = MyMACD2 - MACDAvg2 ;

Plot4( MyMACD2, "MACD" ) ;
Plot5( MACDAvg2, "MACDAvg" ) ;
Plot6( MACDDiff2, "MACDDiff" ) ;

inputs: FastLength3( 52 ), SlowLength3( 104 ), MACDLength3( 9 ) ;
variables: MyMACD3( 0 ), MACDAvg3( 0 ), MACDDiff3( 0 ) ;

MyMACD3 = MACD( Close, FastLength3, SlowLength3 ) ;
MACDAvg3 = XAverage( MyMACD3, MACDLength3 ) ;
MACDDiff3 = MyMACD3 - MACDAvg3 ;

Plot7( MyMACD3, "MACD" ) ;
Plot8( MACDAvg3, "MACDAvg" ) ;
Plot9( MACDDiff3, "MACDDiff" ) ;
Plot10( 0, "ZeroLine" ) ;

If MyMACD > MACDAvg then
	Begin
	Plot1 (High, "Bull") ;
	Alert;
	end
	
	else
	NoPlot( 1 ) ; { remove the marker }
		
If MyMACD < MACDAvg then
	Begin
	Plot2 (Low, "Bear");
	Alert;
	end
	
	else
	NoPlot( 1 ) ; { remove the marker }

If MyMACD2 > MACDAvg2 then
	Begin
	Plot3 (High, "Bull") ;
	Alert;
	end
	
	else
	NoPlot( 1 ) ; { remove the marker }
		
If MyMACD2 < MACDAvg2 then
	Begin
	Plot4 (Low, "Bear");
	Alert;
	end
	
	else
	NoPlot( 1 ) ; { remove the marker }
	
	
	If MyMACD3 > MACDAvg3 then
	Begin
	Plot5 (High, "Bull") ;
	Alert;
	end
	
	else
	NoPlot( 1 ) ; { remove the marker }
		
If MyMACD3 < MACDAvg3 then
	Begin
	Plot6 (Low, "Bear");
	Alert;
	end
	
	else
	NoPlot( 1 ) ; { remove the marker }
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.

Thanks again
Saraf64

Reply With Quote
 
(login for full post details)
  #7 (permalink)
Saraf64
Los Angeles, CA, USA
 
 
Posts: 14 since Mar 2014
Thanks: 3 given, 0 received


NW27 View Post
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

Thank you NW,

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.

Thanks again for your input.

Reply With Quote
 
(login for full post details)
  #8 (permalink)
 ABCTG   is a Vendor
 
 
Posts: 2,238 since Apr 2013
Thanks: 417 given, 1,489 received

Saraf64,

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.

Regards,
ABCTG


Saraf64 View Post
ABC,

Here's what I have so far and it is quite obvious that I am nowhere near where I want to be

 
Code
inputs: FastLength( 12 ), SlowLength( 26 ), MACDLength( 9 ) ;
variables: MyMACD( 0 ), MACDAvg( 0 ), MACDDiff( 0 ) ;

MyMACD = MACD( Close, FastLength, SlowLength ) ;
MACDAvg = XAverage( MyMACD, MACDLength ) ;
MACDDiff = MyMACD - MACDAvg ;

Plot1( MyMACD, "MACD" ) ;
Plot2( MACDAvg, "MACDAvg" ) ;
Plot3( MACDDiff, "MACDDiff" ) ;

	
inputs: FastLength2( 26 ), SlowLength2( 52 ), MACDLength2( 9 ) ;
variables: MyMACD2( 0 ), MACDAvg2( 0 ), MACDDiff2( 0 ) ;

MyMACD2 = MACD( Close, FastLength2, SlowLength2 ) ;
MACDAvg2 = XAverage( MyMACD2, MACDLength2 ) ;
MACDDiff2 = MyMACD2 - MACDAvg2 ;

Plot4( MyMACD2, "MACD" ) ;
Plot5( MACDAvg2, "MACDAvg" ) ;
Plot6( MACDDiff2, "MACDDiff" ) ;

inputs: FastLength3( 52 ), SlowLength3( 104 ), MACDLength3( 9 ) ;
variables: MyMACD3( 0 ), MACDAvg3( 0 ), MACDDiff3( 0 ) ;

MyMACD3 = MACD( Close, FastLength3, SlowLength3 ) ;
MACDAvg3 = XAverage( MyMACD3, MACDLength3 ) ;
MACDDiff3 = MyMACD3 - MACDAvg3 ;

Plot7( MyMACD3, "MACD" ) ;
Plot8( MACDAvg3, "MACDAvg" ) ;
Plot9( MACDDiff3, "MACDDiff" ) ;
Plot10( 0, "ZeroLine" ) ;

If MyMACD > MACDAvg then
	Begin
	Plot1 (High, "Bull") ;
	Alert;
	end
	
	else
	NoPlot( 1 ) ; { remove the marker }
		
If MyMACD < MACDAvg then
	Begin
	Plot2 (Low, "Bear");
	Alert;
	end
	
	else
	NoPlot( 1 ) ; { remove the marker }

If MyMACD2 > MACDAvg2 then
	Begin
	Plot3 (High, "Bull") ;
	Alert;
	end
	
	else
	NoPlot( 1 ) ; { remove the marker }
		
If MyMACD2 < MACDAvg2 then
	Begin
	Plot4 (Low, "Bear");
	Alert;
	end
	
	else
	NoPlot( 1 ) ; { remove the marker }
	
	
	If MyMACD3 > MACDAvg3 then
	Begin
	Plot5 (High, "Bull") ;
	Alert;
	end
	
	else
	NoPlot( 1 ) ; { remove the marker }
		
If MyMACD3 < MACDAvg3 then
	Begin
	Plot6 (Low, "Bear");
	Alert;
	end
	
	else
	NoPlot( 1 ) ; { remove the marker }
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.

Thanks again
Saraf64


Follow me on Twitter Reply With Quote
 
(login for full post details)
  #9 (permalink)
Saraf64
Los Angeles, CA, USA
 
 
Posts: 14 since Mar 2014
Thanks: 3 given, 0 received


ABCTG View Post
Saraf64,

you are using duplicate plot numbers in your code...

Regards,
ABCTG

ABC,

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.

 
Code
inputs: FastLength( 12 ), SlowLength( 26 ), MACDLength( 9 ) ;
variables: MyMACD( 0 ), MACDAvg( 0 ), MACDDiff( 0 ) ;

MyMACD = MACD( Close, FastLength, SlowLength ) ;
MACDAvg = XAverage( MyMACD, MACDLength ) ;
MACDDiff = MyMACD - MACDAvg ;
	
inputs: FastLength2( 26 ), SlowLength2( 52), MACDLength2( 9 ) ;
variables: MyMACD2( 0 ), MACDAvg2( 0 ), MACDDiff2( 0 ) ;

MyMACD2 = MACD( Close, FastLength2, SlowLength2 ) ;
MACDAvg2 = XAverage( MyMACD2, MACDLength2 ) ;
MACDDiff2 = MyMACD2 - MACDAvg2 ;

inputs: FastLength3( 52 ), SlowLength3( 104), MACDLength3( 9 ) ;
variables: MyMACD3( 0 ), MACDAvg3( 0 ), MACDDiff3( 0 ) ;

MyMACD3 = MACD( Close, FastLength3, SlowLength3 ) ;
MACDAvg3 = XAverage( MyMACD3, MACDLength3 ) ;
MACDDiff3 = MyMACD3 - MACDAvg3 ;

If MyMACD crosses above MACDAvg then
	Begin
	Plot2 (High, "Bull") ;
	Alert;
	end
	
	else
	NoPlot( 1 ) ; { remove the marker }
		
If MyMACD crosses below MACDAvg then
	Begin
	Plot3 (Low, "Bear");
	Alert;
	end
	
	else
	NoPlot( 1 ) ; { remove the marker }

If MyMACD2 crosses above MACDAvg2 then
	Begin
	Plot4 (High, "Bull") ;
	Alert;
	end
	
	else
	NoPlot( 1 ) ; { remove the marker }
		
If MyMACD2 crosses below MACDAvg2 then
	Begin
	Plot5 (Low, "Bear");
	Alert;
	end
	
	else
	NoPlot( 1 ) ; { remove the marker }
	
	If MyMACD3 crosses above MACDAvg3 then
	Begin
	Plot6 (High, "Bull") ;
	Alert;
	end
	
	else
	NoPlot( 1 ) ; { remove the marker }
		
If MyMACD3 crosses below MACDAvg3 then
	Begin
	Plot7 (Low, "Bear");
	Alert;
	end
	
	else
	NoPlot( 1 ) ; { remove the marker }
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

Thanks again

Regards
Saraf64

Reply With Quote
 
(login for full post details)
  #10 (permalink)
 ABCTG   is a Vendor
 
 
Posts: 2,238 since Apr 2013
Thanks: 417 given, 1,489 received


Saraf64,

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.

Regards,
ABCTG

Follow me on Twitter Reply With Quote
 
(login for full post details)
  #11 (permalink)
Saraf64
Los Angeles, CA, USA
 
 
Posts: 14 since Mar 2014
Thanks: 3 given, 0 received

Thank you ABCTG, although I must admit what you said in your last post completely went over my head. I will try to read and understand with a fresh mind after I have slept for 12 hours. It's been a long night

Thank you and have a great night.

Regards
Saraf64

Reply With Quote
 
(login for full post details)
  #12 (permalink)
 ABCTG   is a Vendor
 
 
Posts: 2,238 since Apr 2013
Thanks: 417 given, 1,489 received

Saraf64,

if something is unclear just let me know and I'll try to clarify it.

Regards,
ABCTG


Saraf64 View Post
Thank you ABCTG, although I must admit what you said in your last post completely went over my head. I will try to read and understand with a fresh mind after I have slept for 12 hours. It's been a long night

Thank you and have a great night.

Regards
Saraf64


Follow me on Twitter Reply With Quote
 
(login for full post details)
  #13 (permalink)
Saraf64
Los Angeles, CA, USA
 
 
Posts: 14 since Mar 2014
Thanks: 3 given, 0 received


ABCTG View Post
Saraf64,

if something is unclear just let me know and I'll try to clarify it.

Regards,
ABCTG

I think you read my mind. I've been reading and re-reading your post about variables and CurrentBar, and I think I understand what needs to be done, but I don't know how the structure is supposed to be. This is how I am thinking it should be:

If MACD A is CurrentBar and = 0, then PlotX when MACD B is = OR > CurrentBar. I am guessing I am not even close to what I need to do, but I am brainstorming with myself and referring to the EL tutorial PDF, which by the way, doesn't explain enough. That said, how would I go about asking MACD B not to plot if the BarCount is > 5?

Thank you for trying to help me out and get me going.

Vielen dank

Saraf64

Reply With Quote
 
(login for full post details)
  #14 (permalink)
 ABCTG   is a Vendor
 
 
Posts: 2,238 since Apr 2013
Thanks: 417 given, 1,489 received

Saraf64,

it would look something like this. On an up cross of MACDA you store the current bar number and then you can use this variable later on an up cross of MACDB.

 
Code
If MyMACD crosses above MACDAvg then
 MACDAUpCrossBar = CurrentBar;

if MyMACD2 crosses above MACDAvg2 and CurrentBar <= MACDAUpCrossBar + 5 then...
Regards,
ABCTG

Follow me on Twitter Reply With Quote
 
(login for full post details)
  #15 (permalink)
Saraf64
Los Angeles, CA, USA
 
 
Posts: 14 since Mar 2014
Thanks: 3 given, 0 received


ABCTG View Post
Saraf64,

it would look something like this. On an up cross of MACDA you store the current bar number and then you can use this variable later on an up cross of MACDB.

 
Code
If MyMACD crosses above MACDAvg then
 MACDAUpCrossBar = CurrentBar;

if MyMACD2 crosses above MACDAvg2 and CurrentBar <= MACDAUpCrossBar + 5 then...
Regards,
ABCTG

Yup! I was nowhere close to that

Unfortunately I am done for the day, but looks like I am going to have a lot to play with.

Thanks much for the follow up.

Regards
Saraf64

Reply With Quote
 
(login for full post details)
  #16 (permalink)
Saraf64
Los Angeles, CA, USA
 
 
Posts: 14 since Mar 2014
Thanks: 3 given, 0 received


ABCTG View Post
Saraf64,

 
Code
If MyMACD crosses above MACDAvg then
 MACDAUpCrossBar = CurrentBar;

if MyMACD2 crosses above MACDAvg2 and CurrentBar <= MACDAUpCrossBar + 5 then...

Hello ABCTG,

Can you please clarify MACDAUpCrossBar? Assuming that MACDA is MACD, MACDUpCrossBar gives me an "unknown identifier" error. What can I replace it with for it to be recognized? I tried to condition the cross above/below "Condition1" and "Condition2" and equal it to CurrentBar, but that also gave me an error. I am going to try to make some sense out of the logic, watch the TradeStation EL tutorial video a couple of times, read some more and make something out of it.

Thanks again

Regards
Saraf64

Reply With Quote
 
(login for full post details)
  #17 (permalink)
 ABCTG   is a Vendor
 
 
Posts: 2,238 since Apr 2013
Thanks: 417 given, 1,489 received

Saraf64,

MACDAUpCrossBar is just a variable that I named that way. You are free to give it a different name, but make sure that you declare your variable.

Regards,
ABCTG


Saraf64 View Post
Hello ABCTG,

Can you please clarify MACDAUpCrossBar? Assuming that MACDA is MACD, MACDUpCrossBar gives me an "unknown identifier" error. What can I replace it with for it to be recognized? I tried to condition the cross above/below "Condition1" and "Condition2" and equal it to CurrentBar, but that also gave me an error. I am going to try to make some sense out of the logic, watch the TradeStation EL tutorial video a couple of times, read some more and make something out of it.

Thanks again

Regards
Saraf64


Follow me on Twitter Reply With Quote
 
(login for full post details)
  #18 (permalink)
Saraf64
Los Angeles, CA, USA
 
 
Posts: 14 since Mar 2014
Thanks: 3 given, 0 received


ABCTG View Post
Saraf64,

MACDAUpCrossBar is just a variable that I named that way. You are free to give it a different name, but make sure that you declare your variable.

I thought that was what it was and I tried a few things, but as a rookie I am ought to make rookie errors

Thank you for clarifying and explaining things. Your posts are very helpful.

Thanks again
Saraf64

Reply With Quote
 
(login for full post details)
  #19 (permalink)
 ABCTG   is a Vendor
 
 
Posts: 2,238 since Apr 2013
Thanks: 417 given, 1,489 received

Saraf64,

you are welcome and no worries, practice makes perfect.

Regards,
ABCTG


Saraf64 View Post
I thought that was what it was and I tried a few things, but as a rookie I am ought to make rookie errors

Thank you for clarifying and explaining things. Your posts are very helpful.

Thanks again
Saraf64


Follow me on Twitter Reply With Quote
 
(login for full post details)
  #20 (permalink)
 malibu 
toronto canada
 
Experience: Advanced
Platform: Matlab + NT + TS
Trading: FOREX
 
malibu's Avatar
 
Posts: 65 since Jul 2013
Thanks: 9 given, 17 received


ABCTG View Post
Saraf64,

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.

Regards,
ABCTG

Exactly this

Reply With Quote
The following user says Thank You to malibu for this post:
 
(login for full post details)
  #21 (permalink)
Saraf64
Los Angeles, CA, USA
 
 
Posts: 14 since Mar 2014
Thanks: 3 given, 0 received


malibu View Post
Exactly this

Thanks Malibu. I started doing exactly that and after a lot of reading a online search I figured out a way to do it, but I found a bug or two (minor issue I hope) and then I got carpal tunnel

Thank you for the feedback

Saraf64

Reply With Quote
 
(login for full post details)
  #22 (permalink)
ezrollin
Cleburne
 
 
Posts: 7 since Dec 2019
Thanks: 12 given, 0 received

Hey guys, I'm basically trying to do the exact same thing as you. I'm looking for MACD crossovers. Seems like I get false readings sometimes.


How would I stop out of the strategy immediately if the play doesnt go in my favor?
The MACD is still crossed over bullish but the price action went bearish.



Also... What is the tradestation ticker for the /ES (S&P 500 FUTURES)???
thanks

Attached Thumbnails
Click image for larger version

Name:	sss.png
Views:	61
Size:	53.2 KB
ID:	281330  
Reply With Quote
 
(login for full post details)
  #23 (permalink)
ezrollin
Cleburne
 
 
Posts: 7 since Dec 2019
Thanks: 12 given, 0 received

I was trying to make a strategy based on only taking buys when theres a macd cross thats also above the zero line.
I was getting false positives.
I dont know what i'm doing
thanks




Quoting 
{ Search Tag: WA-MACD LE }


SetStopLoss(1);
[IntraBarOrderGeneration = TRUE]



inputs:
FastLength( 12 ) [DisplayName = "FastLength", ToolTip =
"Enter number of bars to use in calculation of shorter length moving average."],
SlowLength( 26 ) [DisplayName = "SlowLength", ToolTip =
"Enter number of bars to use in calculation of longer length moving average."],
MACDLength( 9 ) [DisplayName = "MACDLength", ToolTip =
"Moving Average Convergence Divergence Length. Enter the number of bars to use in smoothing the MACD value."];

variables:
MyMACD( 0.000 ),
MACDAvg( 0.000 ),
MACDDiff( 0.000 );

MyMACD = MACD( Close, FastLength, SlowLength );
MACDAvg = XAverage( MyMACD, MACDLength );


{ CB > 2 check used to avoid spurious cross confirmation at CB = 2 (at CB = 1,
MyMACD and MACDAvg will be the same) }
//if CurrentBar > 2 and MACDDiff crosses over 0 then
// Buy ( !( "MACD LE" ) ) next bar at market;





if (MyMACD > 0.008) and (MyMACD crosses above MACDAvg) then Buy(!("MACD Buy")) this bar 1 shares; {LIMIT}

if (MyMACD < MACDAvg) or (MyMACD = MACDAvg) then Sell("MACD Sell") this bar;


//print (MyMACD);
//print (macdavg);

print ("Profit: " , GrossProfit , " Loss: " , GrossLoss , " Losers: " , NumLosTrades , " PercentProfit: " , PercentProfit , "% Total Trades: " , TotalTrades);


Reply With Quote


futures io Trading Community Platforms and Indicators TradeStation > MACD Strategy HELP!


Last Updated on March 7, 2020


Upcoming Webinars and Events
 

NinjaTrader Indicator Challenge!

Ongoing
 

Journal Challenge w/$1,800 in prizes!

April

Seven Trading Mistakes Solved With Smart Trading Tools w/Brannigan Barrett

Elite only
     



Copyright © 2021 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, +507 833-9432, info@futures.io
All information is for educational use only and is not investment advice.
There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
no new posts