SmartForexExpert

Expert Advisors => SFE Stock Market EAs => Topic started by: Attractor on January 26, 2020, 10:09:50 PM

Title: SFE Stock Market
Post by: Attractor on January 26, 2020, 10:09:50 PM


Marketplace MT5: https://www.mql5.com/en/market/product/46509 (https://www.mql5.com/en/market/product/46509)

Backtest and setup video: https://youtu.be/kORGk-XWoZU (https://youtu.be/kORGk-XWoZU)

Live Signal: https://www.mql5.com/en/signals/692635 (https://www.mql5.com/en/signals/692635)

Myfxbook: https://www.myfxbook.com/members/atractor/sfe-stock-market/4394227 (https://www.myfxbook.com/members/atractor/sfe-stock-market/4394227)

Recommended broker: https://smartforexexpert.com/index.php?topic=13.0 (https://smartforexexpert.com/index.php?topic=13.0)


General description

The EA assumes a general uptrend, which is the general behaviour of the stock market and enters in the pullback. Also have some capacity of avoid entries during quick drops.

The EA don't do partial closure, and the management of the open order affects only to the position of the SL, which can be moved up.

Take as an example the next image:

(https://i.ibb.co/vDk5c6X/general.png) (https://ibb.co/KmWZ5pK)


Number of positions and risk setup

(https://i.ibb.co/CtYvJPz/risk.png) (https://ibb.co/n0Yf3Pb)


Backtest using a fixed balance of 10.000 for calculate the size of the position.

(https://i.ibb.co/gV37sMh/bt1.png) (https://ibb.co/NSs3w6b)

(https://i.ibb.co/MBwCR6w/results.png) (https://ibb.co/qJqrR5q)


Backtest with a starting balance equal to the DowJones Index value (1), and the value of the 'index' at the final of the backtest (2)

(https://i.ibb.co/gjgxWcj/bt2.png) (https://ibb.co/WxKLzRx)


Darwinex US stock selection

16 max. positions and 1% risk / trade is recommended in this selection

you have to be sure the index symbol is selected in the market watch. All the other symbols, are selected automatically if they aren't

For backtest and on live, you can use an EURUSD chart. Darwinex don't have EURUSD in his stock account, then, you can use for example the index symbol WS30. But beware, if you want to do a long term backtest in Darwinex, use a stock symbol, for example ABT, because WS30 don't have the m5 bars of the earlier years, then, you will not receive trades these years.


Index Symbol Name:    WS30

Symbol_List1
ABT;AEP;AMT;ALL;BA;APD;BMY;BDX;BSX;CCI;CNC;CRM;D;DIS;DG;DHR;EL;EW;HCA;HUM;ITW

Symbol_List2
HD;HON;ICE;JNJ;JPM;MMC;LOW;KO;LLY;LMT;MA;MCD;MMM;SYK;SYY;NEE;NKE;NOC;PLD;SHW;SPGI

Symbol_List3
SRE;STZ;TMO;TJX;TRV;TSN;UNH;UNP;V;WM;ZTS;AAPL;ADBE;ADI;ADP;AMAT;AMGN;AMZN;ATVI;AVGO

Symbol_List4
ADSK;CHTR;CMCSA;CME;COST;CSX;FB;FOXA;GILD;GOOG;IAC;INTU;ISRG;KLAC;LRCX;MAR;MDLZ

Symbol_List5
MSFT;NFLX;NVDA;PEP;PYPL;ORLY;ROST;SBUX;TTWO;ULTA;TSLA;TXN;VRTX
Title: Re: SFE Stock Market
Post by: Jimmy on February 02, 2020, 02:24:09 PM
Hi Joel,

It's an exciting new EA, but I just wonder how it would manage if there is a crash in the stock market like what we saw with the GFC in 2008?

We had Black Monday in 1987, Dot Com Bubble in 2000, GFC in 2008 and people have been saying for some time that we are about due for another crash, or at least some form of correction in the near future. I wonder how the EA would manage if the stock market goes down 30-50% from here like it did during those corrections?

Or perhaps I should wait for the long overdue correction to happen first, then start using this EA....? ::)
Title: Re: SFE Stock Market
Post by: Attractor on February 04, 2020, 08:07:43 PM
I will reply this question and post more information soon  ;)

Last days I have ended exhausted after the work on the cloned mt4 - mt5 versions of my last EAs. I will return to the stocks soon.
Title: Re: SFE Stock Market
Post by: Attractor on February 20, 2020, 12:19:19 AM
I just finished my last tests in live with the SFE Stock Market, I'm happy with the current stage of development, and my intention is publish it this week.

The strenght of this EA is add more diversification to the portfolios. As we can imagine, the profit of this EA don't have any relation to any of the forex EAs.

The EA now give me enough signals that can overperform the index.
Obviously, if the Stock market falls strong, the EA also will fall, but is expected that fall less, and will recover quickly, and as we know, stock market tends to growth since the begin of the times, so, I expect a lot of this EA.

This first version, will work with USA stocks, in brokers like ICMarkets. In MT5.

I attached in the first message the backtest. One with a selection of pairs of ICMarkets, from 2018, and other with other selection of pairs of Darwinex. At least in my ICMarkets platform, I can't get prices prior 2018.
Title: Re: SFE Stock Market
Post by: Attractor on February 25, 2020, 12:45:05 AM
Stock Market EA published!
Title: Re: SFE Stock Market
Post by: Attractor on February 26, 2020, 12:33:07 PM
what a drop if the index!! the EA will be ready for take profit with the rebound  8)
Title: Re: SFE Stock Market
Post by: Jamicon on February 26, 2020, 02:19:02 PM
It has started really well, making profits when market is going up, and staying out while this chaos is going on.
Any plans for it being included in SFE Evolution (MT5)?
Title: Re: SFE Stock Market
Post by: Castellers de Vilafranca on March 05, 2020, 07:24:15 AM
EA hasn't taken any trades since Feb 19 is it still attached to the market Joel?
Title: Re: SFE Stock Market
Post by: Attractor on March 05, 2020, 05:29:43 PM
It has started really well, making profits when market is going up, and staying out while this chaos is going on.
Any plans for it being included in SFE Evolution (MT5)?

Not for the moment because merge both worlds in the same EA have difficulties at different levels. For this reason I named Evolution FX (forex).
After I got more experience in the stocks EA, will see if I change my mind. For the moment, I want to expand the current EA to other stock markets.
Title: Re: SFE Stock Market
Post by: Attractor on March 05, 2020, 05:32:00 PM
EA hasn't taken any trades since Feb 19 is it still attached to the market Joel?

yes is attached, but this EA only trade in the LONG side, then, open new trades is forbidden in the middle of a big correction. Just today my filter of the correction is changing his value, then, maybe tomorrow we can see new trades.
Title: Re: SFE Stock Market
Post by: Castellers de Vilafranca on March 05, 2020, 08:58:41 PM
EA hasn't taken any trades since Feb 19 is it still attached to the market Joel?

yes is attached, but this EA only trade in the LONG side, then, open new trades is forbidden in the middle of a big correction. Just today my filter of the correction is changing his value, then, maybe tomorrow we can see new trades.

Cool. I am very interested to watch it. I like that it has stayed out of the market. Very good. Long only, if only that worked on FX haha :)
Title: Re: SFE Stock Market
Post by: Attractor on March 11, 2020, 02:48:49 PM
I reply here some interesting questions I have received by PM:

I have a few questions about your newest EA - Stock market. It looks very interesting to me, it's been wild trading the last weeks or even months for me and i am looking for something more calm to diversify with.
I love the way it has handled the last weeks, staying completely out.
1. Is it doing that by itself automatically or are you manually stopping it?


- is automated, based on the 'index' symbol, in the case of EEUU market, the Dow Jones 30. (US30 in ICMarkets)

2. Will it take a lot for it to stay out or will that happen frequently? (Ie long periods without trades)

- the new trades are forbidden when the index symbol is in a strong correction, like last days, as soon the indicators of strong correction passed, this filter will allow again new trades.  As we can see in the backtest, in the average, 1 or 2 months every year can be in this situation.

3. How many stocks will it trade and what is the expected maximum number of open positions at the same time (if you set it to max)?

- depending on the broker his list of markets and stocks can be different. In general, any broker that offers  stock cfds will have the US market sure with enough symbols. What I do, is select the list of symbols that are companies with good growth perspectives, in the case of the ICMarket CFDs, I have made a selection of 60 stocks. I will propose the companies in different brokers and markets, but is easy, any company with growth is a 'good' company.
The max. num. of stocks is a parameter, combining this with the balance assigned to each position, you can have an idea of your exposition if max. number of trades are opened. The default value I work for the US market is 8 positions max, and a percentage / position of 40%. This mean, that if all the positions are live at the same time, the invested amount is 8 x 40 = 320% of the balance. The minima leverage I see in the brokers is 1:5 (icmarkets is 1:20), then, with 320% of the balance you are far enough of the 1:5 leverage in any case.

3. Is there any upcoming work planned for it or are you done for now?
is not done, is just the beginning. I'm making an extra effort last weeks for have all the Forex EAs in a good position, because once this is done, I want to dedicate my main efforts to open this market.
I'm sure I can improve this EA a lot, is just his first version, and I expect to have new ideas and add other Stock based EAs in the next months / years.

Because this markets is not only 1, in some brokers we can access to hundreds or even thousands of stock cfds. And obviously is totally different of currency market, then, is a very good way to diversify the Forex portfolio.

The objective of this EA is beat by a good distance the reference index, and we know that the index in more of 100 years of history always growth at final, then, I expect a lot of this EA.

My short time task on this EA is define the list of symbols in the Darwinex broker, who have a very good list of US CFDs.
Title: Re: SFE Stock Market
Post by: nok on March 12, 2020, 07:09:44 AM
I wonder why SFE Stock Market trades only long. Shouldn't it be exactly the opposite? Stocks tend to rise over time, but price action to the downside is much more powerful.
Title: Re: SFE Stock Market
Post by: Castellers de Vilafranca on March 12, 2020, 10:44:05 PM
Because then you are always trading with the advantage of the direction of the overall trend
Title: Re: SFE Stock Market
Post by: Attractor on March 12, 2020, 11:59:50 PM
Because then you are always trading with the advantage of the direction of the overall trend

Yes, is just that. This EA is not a 'price action system'. Enter long in the pullbacks of an uptrend or range market. This crash is making a lot of room for the n next years...
I'm reviewing the US Stocks CFD on Darwinex right now, there are more cfds than ICMarkets.
Title: Re: SFE Stock Market
Post by: Attractor on March 19, 2020, 08:51:43 PM
Darwinex US stocks selection

Find the backtest on the first message

(https://i.ibb.co/kHNBpx7/darwinex.png) (https://ibb.co/SsFy2Pj)

(you have to be sure the index symbol is selected in the market watch. All the other symbols, are selected automatically if they aren't)

Index Symbol Name:    WS30 

Symbol_List1:  ABT;AEP;AMT;ALL;BA;APD;AZO;BMY;BDX;BSX;CCI;CNC;CRM;D;DIS;DG;DHR;EL;EW;HCA;HUM;ITW

Symbol_List2:  HD;HON;ICE;JNJ;JPM;MMC;LOW;KO;LLY;LMT;MA;MCD;MMM;SYK;SYY;NEE;NKE;NOC;PLD;RTN;SHW;SPGI

Symbol_List3:  SRE;STZ;TMO;TJX;TRV;TSN;UNH;UNP;V;WM;ZTS;AAPL;ADBE;ADI;ADP;AMAT;AMGN;AMZN;ATVI;AVGO

Symbol_List4:  ADSK;CHTR;CMCSA;CME;COST;CSX;EQIX;FB;FOXA;GILD;GOOG;IAC;INTU;ISRG;KLAC;LRCX;MAR;MDLZ

Symbol_List5:  MSFT;NFLX;NVDA;PEP;PYPL;ORLY;ROST;SBUX;TTWO;ULTA;TSLA;TXN;VRTX
Title: Re: SFE Stock Market
Post by: Attractor on March 21, 2020, 02:33:47 PM
Some questions I have received:

"So for this ea would it still be ok to combine with other eas like in your signal evolution? But you need at least 10000 usd account size for this ea alone ? If this only trade us stock indices is this symbol us500? Which i know only trade minimum 1 lot"

"Not sure what ko.nys is i cant seem to find this on icmarkets"

"None of the symbols i recognise"


- The EA uses the stock indice symbol, for example US30, only for consult the 'look' of the market and disable to open new trades when the market is in a strong correction like the current. But never open trades on the indice.

- Not all the brokers have Stock Market CFD. At this moment, I have tested and I have configurations for ICMarkets and Darwinex. I will post the config files later.
In Darwinex, the stocks are accesible both in mt4 and mt5.
But in general, in brokers that offers stock cfds, they can be traded only in the mt5 platform.
In ICMarket, US and AUS stocks can be traded in his mt5 account, but you have to ask to their support to enable the stock cfds and your account after has been opened. By default, you will not see the stock cfds.  KO.nyse for example is a the cfd of Cocacola in ICMarkets.

- you don't need 10.000 USD only for this EA, this will depend of the broker (the leverage of the stocks in the broker) and you can also can govern this with the number of trades you allow to open and the risk of each trade.

In ICMarkets, with a 10.000 USD account (MT5 account), you can use all the SFE Forex EAs and SFE Stock EA if necessary, is enough balance for all at the same time.

But I will explain a bit better how works the risk and how to understand the needed balance in the next message within today.
Title: Re: SFE Stock Market
Post by: Attractor on March 23, 2020, 08:05:01 PM
Which is the risk of the EA?
The risk is governed by the next three parameters:

[OLD version 1.0]
Max. Number of Positions =  (for example 8  )
Percentage / Position = ( for example 40)
Max. Percentage / Position = (for example 50)

At this moment, there isn't a %risk / trade like we are implementing in the forex EAs, maybe in the next versions.

Now, the risk is based in the % of balance assigned to each position and the max. number of orders.
Then, based in the values of the example above, in this situation, the max. balance in game if all the positions has been opened is a value between:
8 x 40% and 8 x 50%, this is, a value between 320% and 400%.

In most part of the brokers that offers cfds, the required guarantee for hold the position is between 5% and 20%. This is, between 1:20 and 1:5 leverage.

If we go to the lowest leverage, 1:5, this means I can use up to 500% of the balance, for these reason, the operation [num.trades]*[max percentage/position] hast to be under this 500%.

If the leverage is 1:5 and we have 8 position opened, the free margin is low already, but if the broker is 1:20, there is still a lot of margin for use with other EAs.

* why there is 2 values? Percentage / Position and Max. Percentage / Position.

This is because each stock CFD has a minimal size of share to open the position, then, for low balances, sometimes the assigned balance is not enought for open the position. If is not enough, the EA will consult the Max. Percentage parameter, and in some cases this will be enough to open the position because we have more balance assigned. Is like a tolerance to the balance assigned in the case is not enough in the default balance.

In the next version I will implement a parameter for measure the % of risk if all the opened positions hits the SL and establish a limit or raise an alert. At this moment, the most reliable for evaluate the global risk is the backtest itself.

[New version 1.1]

Max. Number of Positions =  (for example 8  )
Percentage risk/trade. Risk assumed in each position (for example 2)
Max. Percentage / Position = (for example 50)

now the size of the position is related to the risk assumed in each position (Percentage risk/trade). The same mode added to the Forex EAs recently.

Then, at any moment, the max. risk is (max. num positons  x % risk /trade). Although we know we can have gaps in the stock market.

In some cases, the size of the position will be reduced, if the value of the parameter 'Max. Balance Percentage / Position' is overpassed.

Then, 8 trades and max 50% of the balance / trade, means that the max. balance used in any moment is 8 x 50% = 400%.
Title: Re: SFE Stock Market
Post by: Attractor on March 23, 2020, 08:05:47 PM
Which are the stocks and the index involved in the EA?

Anyone can propose a list of stocks involved and refer them to his indice. For the moment my proposals are based on the US stocks of ICMarkets and Darwinex.

How I select the stocks? Right now, I'm not selecting the stocks based on which has produced good results in the backtest. The stocks are selected based on his long term trend. I open every symbol, I see the long term trend, and any stocks that have a good looking or average looking uptrend, I select the symbol.

In future version I want to make a script to scan this kind of symbols automatically.
Title: Re: SFE Stock Market
Post by: Attractor on March 24, 2020, 12:05:58 AM
For stocks, would you suggest it is better to spread the risk throughout a higher max positions? Such as 16 instead of 8? Or would a lower max positions pick ‘higher quality’ trades / setups ?

-> Or would a lower max positions pick ‘higher quality’ trades / setups ?   

No, less number of max positions don't mean higher quality, and is not the recommended, because the diversification is low, and the performance is very related with the more or less lucky of this low  numer of setups.

At this moment, I like to have 8 trades in the icmarkets list, and 16 in the darwinex list. This is because the list of darwinex is more large.
The concept is this:
- you want to have a max. number of positions enough to diversify the trading, but without elect a high number of positions, I mean a number close to the number of stocks on the list, because if you do this, will happen very few times that all the positions will be used at the same time, and all the other time, you will trade below the desired total risk.

The image represent this. The red line, the number of trades is to high in relation to the symbols selected, then the desired risk fills very few times.
In this case, the green number of trades is better, the max number of positons will be reached more frequently, then your target risk is more balanced along the time.

(https://i.ibb.co/VS3kjyN/RISK.png) (https://ibb.co/jMHj6K5)

At same time, a low number of positions is not a good idea, not only for low diversification, also because in general all the time the risk will be the max. and this don't represent well the natural flow of the EA with the market, the EA tends to open more positions when is a good moment, then, cut this flow and have always the max. positions opened, is not the best.
Title: Re: SFE Stock Market
Post by: Castellers de Vilafranca on April 20, 2020, 05:15:56 AM
So looks like IC markets you have to apply to pay withholding tax in the USA. But on Darwinex it doesnt look like this is the case, it looks like Darwinex just charges you swaps. So probably Darwinex CFD's are just fake mirrors and they B book it within their own brokerage. I think that must be what happens. Does anyone know what other brokers have US Stocks?

I am very interested in SFE Stock and would prefer to stay with my broker IC Markets but not so sure about filling in IS tax forms with IRS and changing to MT5. Darwinex seems easier but maybe bit more dodgy as they are just being the counterparty I think.

Joel what is the differnce profit wise if we use a broker like IC compared to Darwinex.
What broker has better conditions? Spreads? ICM has less stocks will this affect it alot?
Title: Re: SFE Stock Market
Post by: Attractor on April 20, 2020, 04:57:06 PM
So looks like IC markets you have to apply to pay withholding tax in the USA. But on Darwinex it doesnt look like this is the case, it looks like Darwinex just charges you swaps. So probably Darwinex CFD's are just fake mirrors and they B book it within their own brokerage. I think that must be what happens. Does anyone know what other brokers have US Stocks?

I am very interested in SFE Stock and would prefer to stay with my broker IC Markets but not so sure about filling in IS tax forms with IRS and changing to MT5. Darwinex seems easier but maybe bit more dodgy as they are just being the counterparty I think.

Joel what is the differnce profit wise if we use a broker like IC compared to Darwinex.
What broker has better conditions? Spreads? ICM has less stocks will this affect it alot?

The kind of product is the same in Darwinex and ICMarkets, and they aren't counterpart, they have liquidity providers and the price of the cfd is referenced to the realt stock. The spreads are similar in both, but I like more Darwinex for this:
- they have more stocks, then you can do a wide selection and this is better. And they say will add more markets in the future.
- the minimal size of the positons is not always 10 like ICMarkets. In expensive stocks, can be 1,2,5. Then, you can access to more stocks. Because for example you need a lot of balance for buy Amazon x 10 in a position. Then, the EA discards this entry.
- in both you pay interest for the position, or swap, the name doesn't mind, you pay an interest. In Darwinex this interest is better, last time I checked, 1% less.

For all the previous and because I want to move to EU regulation, I want to move close the ICM Stocks account and move to Darwinex in the future, although Darwinex is currently UK regulated, I don't know what happens now with the brexit in relation to EU regulation. They say there is not problem, but I have to check.

But both broker are quite good just now for trade with CFD stock. ICmarkets have AUS stocks, I want to check when I have time, is a short list but maybe is interesting add them.