March 13


Does the Hammer-Hangman Pattern work on Futures markets?

By Juan

March 13, 2023

Algorithmic Trading, EasyLanguage

Table of Contents

  • A Tradesq Case Study
  • How to use it
  • Some examples
    • Nasdaq(@NQ) 180min:
    • VIX(@VX) 15min
    • Wheat(@W) 480min
    • High Grade Copper(@HG) 240m
  • Conclusion
  • A Tradesq Case Study

    I want to see that the simple pattern called Hammer or Hanging man works in future markets, but before beginning the test let’s see what the pattern is all about:

    Definition: Source

    How to use it

    Short trades: Hammer Pattern and Close are higher than the open. 

    Long trades: Hammer Pattern and Close is lower than the open.

    Now that we understand what a hammer pattern is, lets code in TradeStation Easylenguage the signals, the easiest way to do it, is to look at the resources that TradeStation already has: 

    Within the Prebuilt Studies, ShowMe Section, we can find: C_Hammer_HangingMan

    And it will show us every hammer (Green and Red dots) on the chart:

    Let’s have a look at the code that TradeStation has already developed:

    As we can see, there is already a function called C_Hammer_HangingManso let’s take advantage and proceed to create our code and implement the entry signals:

    Consideration for creating the code:

    • Ability to choose Long only, short only, or both.
    • Random Stop Loss and Profit Target exits.

    Let’s check that our code is working correctly: (Red dot should be a short entry and the green dot a long entry)

    We are ready to upload the code into Tradesq and select all 43 futures markets, the 11 timeframes, and the inputs range we want to test.

    Let’s see the results:

    We have many edges in the currencyenergygrainsindex, and metals sectors.

    Some examples

    Nasdaq(@NQ) 180min:

    VIX(@VX) 15min

    Wheat(@W) 480min

    High Grade Copper(@HG) 240m

    Note: All results include trading costs, slippage and commission.


    This test used a really simple pattern with some random Profit Target and Stop losses, and was only intended to find good edges on the futures markets. Using Tradesq saved us a lot of time and effort in selecting the best results, which found edges on five (5) different sectors of the futures markets. It does not mean these are strategies ready to trade. Additional filters and robustness tests must be applied, but it is a terrific starting point. 

    >> Juan Fernando Gomez from

    About the author

    Hello, my name is Juan Fernando Gómez. I am an Industrial Engineer and an avid triathlete with a passion for developing trading strategies, particularly in the futures markets. My preferred tools are TradeStation and EasyLanguage for Trading, Charting and Coding, and Tradesq for identifying where the edges work. Please feel free to contact me at to discuss further.

    {"email":"Email address invalid","url":"Website address invalid","required":"Required field missing"}

    Learn To Code & Build Strategies
    Using EasyLanguage.