Announcement

Collapse
No announcement yet.

LOT SIZE - Fixed $$ amount, not Number of Shares

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • LOT SIZE - Fixed $$ amount, not Number of Shares

    Hi:
    I am learning EFS, trying to create a Trading System to backtest. Want to buy $10,000 worth of shares, is there an equivalent Strategy variable to do this?

    Strategy.DEFAULT - uses the Default LotSize as the number of shares.

    Thanks,

    DB

  • #2
    DB
    To do that you would need to compute the lot size yourself and then use the result of that calculation in place of Strategy.DEFAULT for your trade entry (see example below)
    Alex

    PHP Code:
    var DollarAmount 10000;
    var 
    CurrentPrice close(0);
    var 
    SharesToTrade Math.round(DollarAmount/CurrentPrice)
        
    if(
    myEntryCondition==true){
        if(!
    Strategy.isLong()) {
            
    Strategy.doLong("Crossing Up",Strategy.CLOSE,Strategy.THISBAR,SharesToTrade);
        }

    if(
    myExitCondition==true && Strategy.isLong()){
        
    Strategy.doSell("Crossing Down",Strategy.CLOSE,Strategy.THISBAR,Strategy.ALL); 

    Comment


    • #3
      Adding conditions & criteria in Backtesting

      Thanks for your response, very helpful.
      I want to add certain filters and conditions in my backtesting (these systems were coded in C++ and I want to test in eSignal ), e.g.

      Only NASdaq stocks that are greater than $10 price, have stock options, and over a defined date range, e.g. Jan 2005 to current.

      Also, I want to get a list of dates of earnings releases and use these in backtesting the trading systems.

      Can you please inform me of the variables and code logic to do these? I am fairly experienced in C++/JAVA/VB NET/PERL, how best to learn to use EFS for backtesting? Where to start?

      Regards,

      Comment

      Working...
      X