Regular visitors will have noticed ever increasing amounts of spam on the Trading Gurus Community Forum. On November 24th 2012 we implemented some changes:

1. New users will be moderated 2. Registered users who have a post count of zero will not be able to view attachments or download code. 3. Registered users who have a post count of zero will not be able to create a new thread

As an additional countermeasure we anticipate introducing a modest paywall in the near future.

If this is your first visit here our apologies for the inconvenience.

Existing users may wish to contribute their ideas to this thread.

Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: EasyLanguage Random Entry Systems

  1. #1
    Administrator Jim's Avatar
    Join Date
    Apr 2010
    Location
    South West England
    Posts
    491

    EasyLanguage Random Entry Systems

    MultiCharts' PowerLanguage is "99% compatible" with TradeStation's EasyLanguage, and the systems that we will present in here should work fine on both platforms. We'll keep any trading systems that work only with PowerLanguage or EasyLanguage in other places.

    As always, the first automated trading strategy we will present is based on "random" entries with fixed take profit and stop loss exits:

    GuruEx01-EZLv100.zip

    Note that for a variety of reasons, this version is not "really random". The entry is based on the direction of the last one minute bar rather than the output of a pseudo-random number generator. The TradeStation platform was originally conceived to work with "bars" rather than "ticks", and that legacy is still apparent in the current incarnation of EasyLanguage and hence PowerLanguage also. For an insight into the trials and tribulations of getting a TradeStation derivative working smoothly with ticks take a look at our initial experiences with FXCM Strategy Trader, which is itself a version of MultiCharts modified to use C# as its programming language instead of PowerLanguage.

    Note too that this version of our trusty "as simple a trading strategy as it is possible to produce" is the shortest so far. The comments take up almost as much space as the code! The code is however slightly longer than you might at first expect. One quirk of EasyLanguage is that your stop and target need to be "refreshed" on every new bar, otherwise you will inadvertently discover that your first trade will never exit, if it doesn't do so on the first bar. Another quirk is that these stops and targets are defined in terms of money rather than pips, so some extra calculations need to be performed to do the conversion. It is also important to remember that if you implement your stops this way, they are ultimately implemented as market orders by the platform, and they are NOT sent to your broker until they have been triggered. Whether you consider this to be a pro or a con depends on whether you are more paranoid about your broker "running stops" or about your internet connection going down.

    Note finally that the "Lots" input setting is currently set to 25,000, which is the minimum size for trading spot forex via IDEALPRO at Interactive Brokers. If you're using GuruEx01 to experiment with FX at LMAX, you might wish to change the default to 1! The same applies if you're experimenting with futures at Interactive Brokers, or any of the other brokers supported by MultiCharts for that matter.
    Reality is merely an illusion, albeit a very persistent one - Albert Einstein

  2. #2
    Hi,
    Thank you for the code. I tried to import the code into MultiCharts but it did not find the file.
    EZL is not one of the import options in MC's PowerLanguage Editor (PLE).
    I opened the EZL file in a text editor & Copy & Paste the code into PLE.
    I ran the Complie but it generated an error message -

    Study: "GuruEx01" (Function)
    Please wait ....
    ------ Compiled with error(s): ------
    incorrect input type
    errLine 24, errColumn 5, errLineEnd 24, errColumnEnd 10
    causal study: (Function)

    This line refers to "Lots(25000),"
    I was not able to Complie & try the system.

    I am running MultiCharts 7.0.4510.400.
    Any help wouldbe appreciated.
    Thank you.
    mb

  3. #3
    Administrator Jim's Avatar
    Join Date
    Apr 2010
    Location
    South West England
    Posts
    491
    Hi Mukesh,

    Welcome to the Trading Gurus community. You're right that the .EZL file is non-standard, the idea being that it is nonetheless easy to cut & paste into whichever Easylanguage compatible editor you happen to be using at the time.

    I just tried on the PowerLanguage Editor version 7.2.4776.200 (strictly speaking still beta) and this was my result:

    21.11.11 18:59:59
    ------ Build started: ------
    Study: "RayMukesh" (Signal)
    Please wait ....
    21.11.11 19:00:07
    ------ Compiled successfully ------

    I suspect the difference is that I opened a blank page in the editor with New->Signal, whereas it looks like you used New->Function instead. Please let me know if that small change fails to fix things for you.

    Cheers,

    Jim
    Reality is merely an illusion, albeit a very persistent one - Albert Einstein

  4. #4
    Junior Member
    Join Date
    Mar 2012
    Posts
    1
    Hi Jim - you have no idea how useful this is (or maybe you do, that's why you posted it). I'm trying to get my head around the LMAX platform / system, and like most of these, the problem is not so much how to code, I've experience with 'old' languages like fortran, pascal etc, but how to implement the whole caboodle.

    OK, so far, got the example to compile fine using PowerLanguage Editor, and backtested too with LMAX Portfolio Backtester.

    A few observations/questions ... I'm feeling very green.

    1. It actually seems to make money on my backtest of two days on EUR/USD 5m. Does it?? I read your warnings, but my golly, it does suggest that we should not get over-sophisticated!
    2. If I have understood what it is doing, it follows the direction of the last bar (long if green, short if red) and then gets out with a target or stoploss hit. It looks like the stoploss is 10x further away than the TP which is why it may make money in the short term. Have I understood the 10x thing?
    3. With backtesting I didn't see how or where I could view the outputs of your 'print' commands. Maybe you can't.
    4. I don't really how to interpret the BigPointValue / Pricescale thing. I mean, I can see what it's getting at, but it would be useful to know how you can get choose those values so you can actually know where the stoploss will fall given say a StopLoss (10000) value. Any chance of a worked example?
    5. I can see that the program essentially asks "Are you in a position or not? If no, then do all these things. If yes, then set the stop loss and the target again ... and again ... and again as long as you are in a position". Can't quite get my head around that. Where have I gone wrong?
    6. A bit of a postscript. You have "Lots (25000)". I think of 1 lot as being $10 a point. Are you really (even in an example) going $250K a point? Otherwise, please help me understand what a lot is in this context.

    Thank you so much, and look forward to your reply.
    Last edited by Ernest; 03-14-2012 at 05:38 PM. Reason: Missed out a question

  5. #5
    Administrator Jim's Avatar
    Join Date
    Apr 2010
    Location
    South West England
    Posts
    491
    Hi Ernest,

    Quote Originally Posted by Ernest View Post
    Hi Jim - you have no idea how useful this is (or maybe you do, that's why you posted it).
    Welcome to the Trading Gurus community, and thanks for your kind words. The thought had occurred to me that a simple example might come in handy eventually!

    I'm trying to get my head around the LMAX platform / system, and like most of these, the problem is not so much how to code, I've experience with 'old' languages like fortran, pascal etc, but how to implement the whole caboodle.
    EasyLanguage, and hence PowerLanguage, is supposed to be "intuitive" for "traders". It often seems a bit "illogical" at first to "programmers" though! Console yourself with the thought that it generally uses a lot less lines of code than traditional programming languages, for expressing traditional trading ideas at least.

    1. It actually seems to make money on my backtest of two days on EUR/USD 5m. Does it?? I read your warnings, but my golly, it does suggest that we should not get over-sophisticated!
    Ray Robot's motto is Keep It Stupidly Simple (KISS for short). Personally I like this quote from Einstein also:

    "Everything should be kept as simple as possible, but no simpler."

    Don't forget this one too:

    "Past performance is in no way indicative of future results!"

    especially if you've only backtested over 2 days. I certainly wouldn't recommend using this strategy with real money at stake.

    2. If I have understood what it is doing, it follows the direction of the last bar (long if green, short if red) and then gets out with a target or stoploss hit. It looks like the stoploss is 10x further away than the TP which is why it may make money in the short term. Have I understood the 10x thing?
    You have understood correctly, at least in terms of how the strategy and the default settings work. However, the answer to the question about "why it might make money" is left as an exercise for the reader who is interested enough to experiment with the settings!

    3. With backtesting I didn't see how or where I could view the outputs of your 'print' commands. Maybe you can't.
    Try the "Output" tab at the bottom of the PowerLanguage Editor. Not very intuitive I know!

    4. I don't really how to interpret the BigPointValue / Pricescale thing. I mean, I can see what it's getting at, but it would be useful to know how you can get choose those values so you can actually know where the stoploss will fall given say a StopLoss (10000) value. Any chance of a worked example?
    That bit of code is merely attempting to convert from "pips" to "dollars", which is how EasyLanguage "thinks" in many (but not all!) cases. It's also not comprehensive, and depending on your choice of instrument it might come up with an unexpected answer. Does that help at all? If you're happy to think in terms of $/£ instead of pips, which is always a good thing IMHO, the code can be simplified.

    5. I can see that the program essentially asks "Are you in a position or not? If no, then do all these things. If yes, then set the stop loss and the target again ... and again ... and again as long as you are in a position". Can't quite get my head around that. Where have I gone wrong?
    TradeStation and MultiCharts cancel orders at the end of each bar, unless you explicitly set them up again. Hence you do need to set your stop and target over and over again, otherwise you'll quickly find yourself either very rich, or more likely very poor!

    6. A bit of a postscript. You have "Lots (25000)". I think of 1 lot as being $10 a point. Are you really (even in an example) going $250K a point? Otherwise, please help me understand what a lot is in this context.
    25000 is the minimum lot size for spot FX at Interactive Brokers. For LMAX it would be better set to 1 (even on a demo account!). Note also that LMAX don't offer spread "betting". If that's what you're used to, you'll get some unexpected results for your profits and losses also, depending on the instrument(s) you choose to trade. You also might find that eventually you will have to pay tax on your trading profits!

    Thank you so much, and look forward to your reply.
    No problem. Here it is!

    Cheers,

    Jim
    Reality is merely an illusion, albeit a very persistent one - Albert Einstein

  6. #6
    Junior Member
    Join Date
    Oct 2011
    Posts
    5
    Could you post any results by mc on IB of EurUsd at 1h and comment result. From this why don't we tru to built a strategy?

  7. #7
    Administrator Jim's Avatar
    Join Date
    Apr 2010
    Location
    South West England
    Posts
    491
    Hi Bomber,

    I guess I could do that, but what's the point? Wouldn't it be better to start with a trading strategy that uses slightly less "stupid" entries? Ray Robot II for example?

    Cheers,

    Jim
    Reality is merely an illusion, albeit a very persistent one - Albert Einstein

  8. #8
    Junior Member
    Join Date
    Jun 2012
    Posts
    1
    is ray robot 2 a arbitrage robot?

  9. #9
    Administrator Jim's Avatar
    Join Date
    Apr 2010
    Location
    South West England
    Posts
    491
    Hi FX Punk,

    Quote Originally Posted by fxpunk2011 View Post
    is ray robot 2 a arbitrage robot?
    No he is not. In his standard configuration he is a "stupidly simple breakout robot". The majority of his assorted clones can also be configured in "fade breakouts" mode.

    Cheers,

    Jim
    Reality is merely an illusion, albeit a very persistent one - Albert Einstein

  10. #10
    Junior Member
    Join Date
    May 2012
    Location
    BORDEAUX FRANCE
    Posts
    1
    Sorry can't read this file

Page 1 of 2 12 LastLast

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •