Using EasyLanguage To Limit Trades

About the Author Jeff Swanson

Jeff is the founder of System Trader Success - a website and mission to empowering the retail trader with the proper knowledge and tools to become a profitable trader the world of quantitative/automated trading.

follow me on:
  • Red says:

    Hi Jeff,
    I always get concern with a statement of the sort; if time = 800. My programing days go back to Frotran and we were always cautioned about such a statement because of floating point considerations and that time may actually be 799.9999 and not exactly equal to 800 causing the statement to be false rather than true.

    Your thoughts?

    Red

    • This is a good point. Evaluations, such as the one you pointed out, are always potential areas for coding errors. In this case, time is not a floating point number but an integer. Furthermore, when dealing with bar charts the time stamp on any bar is always a known block size. For example, on a 5-minute chart the time stamp on a sequence of bars will be 745, 750, 755, 800, 805. Of course if you use a four minute chart this would not be true. If you were using a specific time to exit a trade you might use “>=800”. However, in this application using “=800” is just fine.

  • Julian Sass says:

    Hi Jeff,

    it might also be useful to limit the number of consecutive trades in any one direction, lets say no more than 3 consecutive longs or shorts for example. An easylanguage example would be most appreciated!!

  • >