I written a program for automated trading and use this below indicator logic as a condition to put the trade. It used to work fine till last week but from today onwards its not working. In other words, it is not returning 1 when the last ten candles close price consistently above EMA20.
When i tested it further, until i check last four candles(including the current one) it works perfectly but when i increase it to last five candles it is giving abnormal results.. attached some screenshots related to this.
Lost quite a bit of money because of abnormal trades system put in. So, Any insight into this will be much appreciated.
Trading on leveraged financial instruments may expose you to risk of loss greater than your deposits and is only suitable for experienced clients with the financial means to bear such risk. Trading on foreign exchange instruments (Forex) and contracts for difference (CFDs) is highly speculative and particularly complex and comes with a high level of risk due to leverage. You must ensure that you understand how these instruments work and that you can afford to take the high risk of losing your money. No information on this site is investment advice or a solicitation to buy or sell any financial instruments.