question about amibroker entry and exit signal

Discussion in 'Trading Software' started by orangelam, Apr 29, 2016.

  1. i am new in amibroker and i have some questions below.

    1)will amibroker accumulate buy signals and then settle all when facing a sell signal? or it is FIFO or LIFO so that we can see clearly each trade in back test?


    2)below, i just want to explore whether amibroker is FIFO or LIFO, but i can't see any result in back test. but scan do have signals pairs appeared. can anyone tell me why?

    SetBacktestMode(backtestRegularraw);
    Buy=Sell=Short=Cover=0;
    BuyPrice=SellPrice=CoverPrice=ShortPrice=0;

    Buy[1]=1;
    BuyPrice[1]=100;
    Buy[2]=1;
    BuyPrice[2]=10;
    Sell[3]=1;
    SellPrice[3]=25;
    Sell[4]=1;
    SellPrice[4]=120;



    3)sometimes, the exit price(sellprice and coverprice) will automatically become 1 or -1, it is weird, is it setting problem?


    many thanks!
     
  2. M.ST.

    M.ST.

    Code:
    SetBacktestMode( backtestRegularRaw );
    SetOption( "PriceBoundChecking", False );
    SetPositionSize( 1, spsShares );
    
    bi = BarIndex();
    
    C[0] = 100;
    C[1] = 10;
    C[2] = 25;
    C[3] = 120;
    
    BuyPrice = C;
    SellPrice = C;
    
    Buy = bi < 2;
    Sell = bi > 1;
    
    Short = Cover = 0;

    Code:
    SetBacktestMode( backtestRegularRawMulti );
    SetOption( "PriceBoundChecking", False );
    SetPositionSize( 1, spsShares );
    
    bi = BarIndex();
    
    C[0] = 100;
    C[1] = 10;
    C[2] = 25;
    C[3] = 120;
    
    BuyPrice = C;
    SellPrice = C;
    
    Buy = bi < 2;
    Sell = bi > 1;
    
    Short = Cover = 0;
     
  3. Hi

    Hi, thanks for telling me. i tried to run your afl, but i found that my exit prices are all 1. i don't know why, i tried many times that, the etries price are at close as mentioned above, but the exit prices are always 1, do you know what happened?

    thanks,
     
  4. Hi

    Hi, thanks for telling me. i tried to run your afl, but i found that my exit prices are all 1. i don't know why, i tried many times that, the etries price are at close as mentioned above, but the exit prices are always 1, do you know what happened?

    thanks,
     
  5. Hi

    Hi, thanks for telling me. i tried to run your afl, but i found that my exit prices are all 1. i don't know why, i tried many times that, the etries price are at close as mentioned above, but the exit prices are always 1, do you know what happened?

    thanks,
     
  6. M.ST.

    M.ST.

    Do a check for incompetence on your end.
    You possibly do mistake number of shares for exit prices.
     
  7. upload_2016-5-2_17-49-51.png


    i reinstalled amibroker, and when i run this again, it become -0.68, which is a open price but in my afl code above, there has no any open prices. and in back test setting, i already set all price to close price for both buy and short side. what really confused me is, in above afl code, only close price is assigned for the two trades but why the exit price is not at close...

    may i know how to check the incompetence?

    by the way, why there is a number 6 near "long"? thank,
     
    Last edited: May 2, 2016
  8. M.ST.

    M.ST.