Tradestation: a Basic Crossover Strategy

Discussion in 'Automated Trading' started by Nashequilibrium, Oct 3, 2006.

  1. twalker

    twalker

    buy this bar on close

    if you use
    [intrabarorderpersist = true]

    then every tick is considered a close price.
     
    #21     Oct 6, 2006
  2. I think this is what you want to do. This won't buy 100 times as the averages cross intrabar. I commented the code pretty well so hopefully you can understand it.
     
    #22     Oct 6, 2006
  3. Plot your two ma's then plot this indicator. When the indicator goes to 1 it expects a crossover on the next bar (be sure that this indicators is using the same ma's that you plotted. If you like it you can use the logic in your strategy.

    Code:
    input: Price(Close), maLen1(10), maLen2(20), tao(2), UpperTx(1.5), LowerTx(-0.5);
    
    var: ma1(0), ma2(0), maX(0), dv(0), tX(0);
    
    ma1 = average(Price, maLen1);
    ma2 = average(Price, maLen2);
    
    dv = (ma1 - ma1[tao])/2 - (ma2 - ma2[tao])/2;
    if (AbsValue(dv) > 0) then
      tX = (ma2 - ma1)/dv;
    
    
    if (tx <= UpperTx) and (tx >= -LowerTx) then
      plot1(1, "xOver")  {crossover expected : buy next bar at open}
    else
      plot1(0, "xOver")  {no crossover expected}
    
    
     
    #23     Oct 6, 2006
  4. When I type the "intrabarorderpersist = true" code into my strategy, I get an error message saying that the the program does not recognize the word intrabarorderpersist. Exactly how and where do I type the code to enable intrabar into my strategy?

    The poblem may be that I do not have the intrabarorderpersist function. Could someone please send me the code for it.

    I have a dialogue box that allows me to enable intrabar order generation, but puting it on does not seem to have any effect on my strategy.
     
    #24     Oct 6, 2006
  5. you must type "[intrabarorderpersist=true]". I would put it as the first line in the strategy.
     
    #25     Oct 6, 2006
  6. I am getting the error message "property is not recognized by easylanguage". It then highlights the "=" in the "[intrabarorderpersist=true]" statement.

    Do I need the intrabarorderpersist function for this to work? I have Tradestation 8.1 (bld 3066), if that is of any help to you.
     
    #26     Oct 6, 2006
  7. Try this...

    Under format strategies, choose format. This is where you modify the inputs. Look for the Calculation tab. You will see the option to enable intrabar orders there. You must use "buy/sell next bar at market" in order for intrabar orders to work.

    I still think the code I posted will more accurately produce the signal you are looking for.
     
    #27     Oct 6, 2006
  8. This is the first option that i tried, but it still doesn't work when i run the strategy, thats why i thought that i needed to do something in the coding.
     
    #28     Oct 6, 2006
  9. OK. I included a workspace with the code I sent earlier (and some more code so you have to import the eld before opening the workspace). The chart on the left uses the method I posted earlier. The chart on the right uses the intrabar order generation method. Load it up and see what you think.
     
    #29     Oct 6, 2006
  10. Hi Nashequilibrium!

    First post here, just found this great site. Anyway I was wondering if we could get an update on how your cross over strategy is working with Trade Station?

    Is it going well?

    I just applied for an account for Trade Station, moving over from Schwab and was looking to implement a similar automated strategy as you.

    Just wondering how it was going?
     
    #30     Nov 2, 2006