Moving-average based stop order

Strategies are published here.

Moderator: admin

Moving-average based stop order

Postby Nikolay.Gekht » Fri Sep 17, 2010 11:06 am

A new version of this strategy exists. Please check it first!

The strategy sets the stop order on the chosen trade using moving average value.

You can apply any of the existing moving average indicator of any price (open, close, high, low, median, typical or weighted) of any time frame and choose the interval in minutes how often the stop order shall be changed.

The strategy starts on the first tick after it's applied, loads the data and starts to watch moving average value. In case moving value value is changed and the stop is changed more than (chosen interval) ago, the new stop value is set. If there is no stop order - the new stop order is created.

The strategy uses the most recent bar of the chosen timeframe, not the already closed bar.

In case moving average is on the wrong side (above the price for a long position or below the price for a short position) the strategy does not set or change the order.

The strategy works for non-FIFO (aka U.S. accounts) only.

Note. The strategy works on 091010 version of the Trading Station only. Do not try to use it on 082610 or older version!!!. To update your trading station up to 091010 version, please, download the most recent installation package from your broker's site download page and install it. FXCM UK download page is http://www.fxcm.co.uk/forex-software-download.jsp

Screenshot:
mvastop.png


Download:
mvastop2.lua
(6.76 KiB) Downloaded 1438 times


p.s. The setting stop order by true timer (i.e. every one minute exact, without waiting for a tick) will be possible in the upcoming Trading Station release.

The Strategy was revised and updated on December 10, 2018.
Nikolay.Gekht
FXCodeBase: Site Admin
 
Posts: 1235
Joined: Wed Dec 16, 2009 6:39 pm
Location: Cary, NC

Re: Moving-average based stop order

Postby shlomohalevi » Wed Oct 27, 2010 6:52 pm

I am seeking an indicator which will alert me when price hits the 200 ema
on the 5 minute chart. Does such an indicator exist ?

Thanks for any help you can offer.

Best,
Shlomo
shlomohalevi
 
Posts: 1
Joined: Thu Oct 14, 2010 4:36 am

Re: Moving-average based stop order

Postby alepan72 » Thu Feb 24, 2011 2:11 pm

Hi Nikolay!
It's a great strategy and I use it on most of my trades.
I wonder, if it's possible to use a similar strategy for profit.
e.g. When price is above the EMA and I am short, close the position if price hit the EMA.
Thanx a lot!
Kisses from Greece!!!
Image
User avatar
alepan72
 
Posts: 59
Joined: Wed Oct 27, 2010 4:19 am

Re: Moving-average based stop order

Postby alepan72 » Fri Feb 25, 2011 1:34 pm

shlomohalevi wrote:I am seeking an indicator which will alert me when price hits the 200 ema
on the 5 minute chart. Does such an indicator exist ?

Thanks for any help you can offer.

Best,
Shlomo


Take a look at this link below....
http://fxcodebase.com/code/viewtopic.php?f=29&t=2386&hilit=price+ma
Image
User avatar
alepan72
 
Posts: 59
Joined: Wed Oct 27, 2010 4:19 am

Re: Moving-average based stop order

Postby arstechnica » Thu Nov 01, 2012 1:19 am

I open trades manually with a stop and take profit imposted in the platform. I have TS 01.11.011212

Then apply the MVASTOP3 to the trade, but it doesn't work.

It doen't move stops to MVA
Is my TS version compatible? Or i need a patch?
arstechnica
 
Posts: 48
Joined: Sat Sep 29, 2012 4:25 am

Re: Moving-average based stop order

Postby Apprentice » Thu Nov 01, 2012 2:50 am

Hm, this needs to be tested.
One question, are you using this, or new version posted by Nikolay.
Alo do you have US FIFO or Non FIFO account.
User avatar
Apprentice
FXCodeBase: Confirmed User
 
Posts: 36341
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia

Re: Moving-average based stop order

Postby arstechnica » Thu Nov 01, 2012 5:04 am

I have an accountwith FXCM Italy in EUR.

I used the first version on non fifo account
arstechnica
 
Posts: 48
Joined: Sat Sep 29, 2012 4:25 am

Re: Moving-average based stop order

Postby arstechnica » Sun Nov 04, 2012 1:42 am

Dear Nick,

How can I introduce this stop inside an existing strategy?

I need it as an option for stop.

Could you please attach the code I have to copy inside the existing strategy?

Thanks
arstechnica
 
Posts: 48
Joined: Sat Sep 29, 2012 4:25 am

Re: Moving-average based stop order

Postby Apprentice » Sun Nov 04, 2012 7:44 am

We can write new strategy that uses this algorithm.
Unfortunately this is not Copy / Paste Job.
User avatar
Apprentice
FXCodeBase: Confirmed User
 
Posts: 36341
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia

Re: Moving-average based stop order

Postby luigipg » Sun Nov 04, 2012 2:54 pm

Hi, can anyone adds to this strategy "distance in pips" from Moving-average? so the stop loss move n pips overside the MA. Thanks. Luigi!!!
luigipg
 
Posts: 74
Joined: Sun May 23, 2010 8:01 am

Next

Return to Custom Strategies

Who is online

Users browsing this forum: Bing [Bot] and 15 guests