Simple Moving Average Strategy

Strategies are published here.

Moderator: admin

Simple Moving Average Strategy

Postby Nikos1978 » Sun Nov 14, 2021 5:06 am

Dear All

Firstly, let me express my gratitude to the developers for all these free strategies. This is such a great job!

Secondly, I would like to share my strategy with you, as well as, have it automated. Strategy goes as follows:

LONG CONDITIONS

If,

a) current bar closes above any given moving average, and
b) current bar closes red

then, create a limit buy order at the high of this bar. If the order is not filled and a new red bar appears, then move the limit buy order at the high of this new red bar. Repeat procedure till an order is filled. If a bar closes below the moving average, then cancel order.

STOP LOSS

If an order is filled, then place stop loss at the low of the signaling bar (BID price).

TRAILING STOP

Check back all bars till the signaling bar. Identify the highest price among these bars. If a bar closes above this high, then check back all bars till the signaling bar. Identify the latest red bar. Move stop loss at the low of this red bar (BID price). If there is no red bar, then leave stop loss intact.

PROFIT TAKING

If a bar closes below the moving average, then close position

SHORT CONDITIONS

If,

a) current bar closes below any given moving average, and
b) current bar closes green

then, create a limit sell order at the low of this bar. If the order is not filled and a new green bar appears, then move the limit sell order at the low of this new green bar. Repeat procedure till an order is filled. If a bar closes above the moving average, then cancel order.

STOP LOSS

If an order is filled, then place stop loss at the high of the signaling bar (ASK price).

TRAILING STOP

Check back all bars till the signaling bar. Identify the lowest price among these bars. If a bar closes below this low, then check back all bars till the signaling bar. Identify the latest green bar. Move stop loss at the high of this green bar (ASK price). If there is no green bar, then leave stop loss intact.

PROFIT TAKING

If a bar closes above the moving average, then close position

FEATURES

Allow for user to set,

i) trading time frame
ii) period & method of the moving average
iii) whether strategy uses BID or ASK price for creating orders
iv) maximum number of open positions after which strategy stops creating entry orders
v) lots to trade as a percentage of equity
vi) time that strategy starts trading
vii) time that strategy stops trading
viii) time of mandatory closing of all open positions

Thank you in advance for accepting to develop this strategy.

My Regards
Nikos1978
 
Posts: 2
Joined: Sat Nov 13, 2021 4:46 am

Re: Simple Moving Average Strategy

Postby Apprentice » Mon Nov 15, 2021 4:01 am

Your request is added to the development list.
Development reference 987.
User avatar
Apprentice
FXCodeBase: Confirmed User
 
Posts: 30723
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia

Re: Simple Moving Average Strategy

Postby Nikos1978 » Mon Nov 15, 2021 6:32 pm

Thank you Apprentice, some amendments regarding features that are important:

vi) time that strategy starts creating entry orders
vii) time that strategy stops creating entry orders & cancels any existing ones

My Regards
Nikos1978
 
Posts: 2
Joined: Sat Nov 13, 2021 4:46 am


Return to Custom Strategies

Who is online

Users browsing this forum: No registered users and 2 guests