Jump to content

Backtesting using variables to test best MACD configuration


Guest Markuskkk

Recommended Posts

Guest Markuskkk

Does anyone know how to back test an automatic trading system that uses macd crossover signals? I understand how to backtest using variables on a moving average but for macd it seems a little more difficult. A snippet of a system below so you can see what I am trying to explain. Any help would appreciated.

 

// Definition of code parameters
DEFPARAM CumulateOrders = False // Cumulating positions deactivated

// Conditions to enter long positions
indicator1 = Average[1](close)
indicator2 = Average[29](close)
c1 = (indicator1 CROSSES OVER indicator2)

indicator3 = MACDline[37/3, 77/3, 9](close)
indicator4 = ExponentialAverage[9](MACDline[37/3, 77/3, 9](close))
c2 = (indicator3 CROSSES OVER indicator4)

IF c1 AND c2 THEN
BUY 1 PERPOINT AT MARKET
ENDIF

Link to comment

Archived

This topic is now archived and is closed to further replies.

  • General Statistics

    • Total Topics
      22,068
    • Total Posts
      92,908
    • Total Members
      42,474
    • Most Online
      7,522
      10/06/21 10:53

    Newest Member
    scobes2
    Joined 17/05/23 10:51
  • Posts

    • Does anyone else know any other SB providers that you can use to trade through TV?  I've only so far seen CFD providers which doesn't work for me due to tax reasons (mainly the hassle of having to account for it as well as the obvious cost).
    • Is there any update on when/if there will be any integration with Tradingview???
    • The anonymity of cryptocurrency transactions can vary depending on the specific cryptocurrency you use and the methods you use. While some cryptocurrencies provide a degree of privacy and anonymity, it is important to note that achieving complete anonymity can be difficult. Most cryptocurrencies operate on a pseudonymous basis. Transactions are recorded in a public ledger, called a blockchain, using cryptographic addresses instead of personal information. However, these addresses are usually not directly linked to a real identity, unless someone voluntarily discloses this information. Some cryptocurrencies, such as Monero (XMR) and Zcash (ZEC), are specifically designed to increase privacy and anonymity. I read on https://deeplab.com/darkweb/anonymous-sudan-launches-cyberattacks-on-middle-eastern-news-outlets-expands-target-list-with-four-additional-names that some people use this anonymity as a cyber attack.
×
×
  • Create New...