Momentum trade strategy

Strategies are published here.

Moderator: admin

Momentum trade strategy

Postby Alexander.Gettinger » Tue Nov 23, 2010 3:35 am

Rules for a Long Trade
1) Look for currency pair to be trading below the MA and MACD to be negative
2) Wait for price to cross above the MA, make sure that MACD is either in the process of crossing from negative to positive or have crossed into positive territory no longer than [MACD_Cross_Distance] bars ago
3) Go long [Open_Distance] pips above the MA

Rules for a Short Trade
1) Look for currency pair to be trading above the MA and MACD to be positive
2) Wait for price to cross below the MA, make sure that MACD is either in the process of crossing from positive to negative or have crossed into negative territory no longer than [MACD_Cross_Distance] bars ago
3) Go short [Open_Distance] pips below the MA

For this strategy must be installed indicator Averages (viewtopic.php?f=17&t=2430).

2018-11-19_11-48-49.png
2018-11-19_11-49-22.png


MomentumTradeStrategy v2.lua
(137.54 KiB) Downloaded 384 times
Attachments
MomentumTradeStrategy.lua
(19.25 KiB) Downloaded 1996 times
Alexander.Gettinger
FXCodeBase: Confirmed User
 
Posts: 3785
Joined: Wed Mar 31, 2010 9:40 pm
Location: Russia, Omsk

Re: Momentum trade strategy

Postby virgilio » Thu Jan 27, 2011 11:37 am

Why is it that when I try to use the Backtest Strategy I always get this message:
Marketscope 2.0
[string "MomentumTradeStrategy.lua"]:141:Unsupported

Can anyone help me with this?
virgilio
 
Posts: 66
Joined: Mon Aug 23, 2010 12:16 pm

Re: Momentum trade strategy

Postby d10gen3 » Thu Jan 27, 2011 1:44 pm

I have te same problem as Virgilio, is there a way to fix it? Looks like many core functins return null.
d10gen3
 
Posts: 11
Joined: Wed Jan 26, 2011 8:18 pm

Re: Momentum trade strategy

Postby a0007002 » Sun Jan 30, 2011 1:57 pm

I too got this same error. Needs something to be fixed. The Averages indicator is installed and works on other strategies requiring it.
a0007002
 
Posts: 6
Joined: Sun Nov 07, 2010 10:35 am

Re: Momentum trade strategy

Postby sunshine » Tue Feb 01, 2011 8:36 am

a0007002 wrote:I too got this same error. Needs something to be fixed. The Averages indicator is installed and works on other strategies requiring it.

The problem you describe appears in the current version, and our team will do everything to resolve the issue as soon as possible. Thank you for pointing to this problem.

If you restart your Trading Station, the error shouldn't appear.
sunshine
 

Re: Momentum trade strategy

Postby a0007002 » Wed Feb 02, 2011 1:30 pm

Closing the program after loading the strategy into the list then re-launching Tradestation worked.
thanks

P.S. - what I did notice tho was that the stop and limit functions didn't seem to work. Not sure if they were supposed to.
a0007002
 
Posts: 6
Joined: Sun Nov 07, 2010 10:35 am

Re: Momentum trade strategy

Postby TMos1124 » Thu Apr 28, 2011 5:37 pm

If I change the code at the stop and limit (default is 1) to 5 that would change the order amount correct? If so, can I just save and run? Is there any way I can edit the trailing stop parameters? Again, your help is invaluable.
TMos1124
 
Posts: 14
Joined: Thu Apr 28, 2011 4:13 pm

Re: Momentum trade strategy

Postby Apprentice » Fri Apr 29, 2011 5:30 am

If you open an indicator using Notpad.
You can edit the line 57-62 according to your preferences.

Code: Select all
strategy.parameters:addInteger("Amount", "Trade Amount in Lots", "", 1, 1, 100);
    strategy.parameters:addBoolean("SetLimit", "Set Limit Orders", "", false);
    strategy.parameters:addInteger("Limit", "Limit Order in pips", "", 30, 1, 10000);
    strategy.parameters:addBoolean("SetStop", "Set Stop Orders", "", false);
    strategy.parameters:addInteger("Stop", "Stop Order in pips", "", 30, 1, 10000);
    strategy.parameters:addBoolean("TrailingStop", "Trailing stop order", "", false);


If wants to increase Trade Amount in Lots to 5 Edit line 57 to
Code: Select all
strategy.parameters:addInteger("Amount", "Trade Amount in Lots", "", 5, 1, 100);
User avatar
Apprentice
FXCodeBase: Confirmed User
 
Posts: 36341
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia

Re: Momentum trade strategy

Postby Blackcat2 » Fri Apr 29, 2011 7:24 am

Can anyone recommend parameters for 15M and 1H TF?

Thanks..
BC
Blackcat2
FXCodeBase: Initiate
 
Posts: 118
Joined: Wed May 19, 2010 12:42 am

Re: Momentum trade strategy

Postby TMos1124 » Mon May 16, 2011 8:24 am

Thank you very much, I would also like to know how to edit line 59. I want the limit to be .5 to the total trade amount. If I were to buy 20 for example, I wish for the limit order to be 10 lots.
TMos1124
 
Posts: 14
Joined: Thu Apr 28, 2011 4:13 pm

Next

Return to Custom Strategies

Who is online

Users browsing this forum: Google [Bot] and 19 guests