My favorites | Sign in
Project Home Downloads Wiki Issues Source
Search
for
LessonBoxHello  
Make a response that says hello.
Updated Sep 11, 2011 by michael....@gmail.com

Introduction

A strategy is made up of trading rules that make buy or sell decisions.

In TradeLink, strategies are called Responses.

Our first example will simply print "Hello World" as a message in the TradeLink applications.

You will find this useful when testing and debugging your responses.

The Examples found in the Responses project (start->programs->tradelink->response examples) contain the finished examples.

Creating the Response

  1. Create a new project in Visual C# Express, of type "class library"
  2. Add a reference to the TradeLinkCommon.dll and TradeLinkAPI.dll where you installed TradeLink
  3. Create a new class that inherits from the ResponseTemplate class (see AlwaysEnter)
  4. using System;
    using TradeLink.Common;
    using TradeLink.API;
    
    namespace Responses
    {
     public class HelloWorld : ResponseTemplate
     {
      
     }
    }
  5. override the GotTick method (see AlwaysEnter)
  6.  public override void GotTick(TradeLink.API.Tick k)
     {
     }
  7. call the debug message with 'hello world' (see debugging in AlwaysEnter)
  8.  D("Hello World");
    
     or
    
     senddebug("Hello World");
  9. Compile your responses (which creates a DLL)
  10. Save your project

Testing the Response

  1. run Kadina, click Add response
  2. browse to your DLL
  3. select your hello response
  4. click Add data and add some sample data
  5. run through the data by clicking one of the Duration buttons
  6. you should see the "Hello World" message in the Messages tab.

Extra credit: Make the hello world response print "Hello World" for the first tick only, then shutdown immediately.

Comment by tehuber...@gmail.com, May 4, 2012

no sample data bundled in the current release. where can i get some?


Sign in to add a comment
Powered by Google Project Hosting