Backtesting and Research: MultiCharts or AmiBroker - AmiBroker | futures io social day trading
futures io futures trading


Backtesting and Research: MultiCharts or AmiBroker
Updated: Views / Replies:31,301 / 74
Created: by dnof Attachments:4

Welcome to futures io.

(If you already have an account, login at the top of the page)

futures io is the largest futures trading community on the planet, with over 90,000 members. At futures io, our goal has always been and always will be to create a friendly, positive, forward-thinking community where members can openly share and discuss everything the world of trading has to offer. The community is one of the friendliest you will find on any subject, with members going out of their way to help others. Some of the primary differences between futures io and other trading sites revolve around the standards of our community. Those standards include a code of conduct for our members, as well as extremely high standards that govern which partners we do business with, and which products or services we recommend to our members.

At futures io, our focus is on quality education. No hype, gimmicks, or secret sauce. The truth is: trading is hard. To succeed, you need to surround yourself with the right support system, educational content, and trading mentors Ė all of which you can find on futures io, utilizing our social trading environment.

With futures io, you can find honest trading reviews on brokers, trading rooms, indicator packages, trading strategies, and much more. Our trading review process is highly moderated to ensure that only genuine users are allowed, so you donít need to worry about fake reviews.

We are fundamentally different than most other trading sites:
  • We are here to help. Just let us know what you need.
  • We work extremely hard to keep things positive in our community.
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts.
  • We firmly believe in and encourage sharing. The holy grail is within you, we can help you find it.
  • We expect our members to participate and become a part of the community. Help yourself by helping others.

You'll need to register in order to view the content of the threads and start contributing to our community.  It's free and simple.

-- Big Mike, Site Administrator

Closed Thread
 4  
 
Thread Tools Search this Thread
 

Backtesting and Research: MultiCharts or AmiBroker

  #51 (permalink)
Elite Member
Newcastle, Australia
 
Futures Experience: Intermediate
Platform: Multicharts 8 - Full Version
Broker/Data: IB
Favorite Futures: SPI,FTSE100, 6E, 6A
 
Posts: 285 since Oct 2010
Thanks: 108 given, 177 received


TonyB View Post
Would be nice to see how that looks in AB. Maybe this might help us a little? Trailing stop loss from the AB AFL library...AmiBroker - AFL Library

Or in Multicharts

 
Code
[IntrabarOrderGeneration = false]
inputs: 
    PositionBasis( false ), 
    FloorAmt( 1 ), 
    TrailingPct( 20 ) ;                              

if PositionBasis then
    SetStopPosition
else
    SetStopShare ;

SetPercentTrailing( FloorAmt, TrailingPct ) ;

 
  #52 (permalink)
Elite Member
Newcastle, Australia
 
Futures Experience: Intermediate
Platform: Multicharts 8 - Full Version
Broker/Data: IB
Favorite Futures: SPI,FTSE100, 6E, 6A
 
Posts: 285 since Oct 2010
Thanks: 108 given, 177 received


ArshT View Post
You can do Intrabar testing too. I.e. simply use timeframe functions and expandfirst. The LAST bar close includes the actual LAST price regardless of timeframe.

More special programming, or in Multicharts, you could just tick a box and select minute or tick data. Also have a look at how you can use the Bid & Ask data to FULLY back test.
Please register on futures.io to view futures trading content such as post attachment(s), image(s), and screenshot(s).



ArshT View Post
It was even answered by T.J.

I must be blind, I didn't see any reference in TJ's cut and pasted comment. At least I'm talking from experience. Unlike you.


ArshT View Post
So please stop the misinformation.

You've yet to show us how I'm wrong, in that within a system, I cannot tell whether I'm in a trade or not.


ArshT View Post
I haven't use custom backtester much yet (just added some additional metrics and code for adding slippage etc) so I don't know how to do it there.

Simple to add slippage in MC. How many dollars would you like??? Again no special coding required.
Please register on futures.io to view futures trading content such as post attachment(s), image(s), and screenshot(s).




ArshT View Post
Just look at the links with examples provided by Tomasz.

None of those links show me how to set a specific number of contracts to Buy or Sell at individual points or whether I'm in a trade, so that I can exit the remander on a ATR trailing stop or what ever. Those links are all relating to trades that are looked at after the fact via the Backtester. Not whilst they are actually happening and price action calcs need to come into play and make decisions on getting In/Out


ArshT View Post
Sorry but wrong again. Both were tested with same conditions in one timeframe backed by a MC user. If time permits and I should feel like then I could do a test with both using intrabar testing.

I wasn't trying to prove I was right or wrong, just a suggestion. You love to say people are wrong.


ArshT View Post
@Tony, if you can work with Excel you can also work with AFL. IMO, it is very simple to use.

Yeah right. When do I use a IF statement as opposed to a IFF statement? When do I use a global variable and when is it in the array of prices? Why do I need an array of prices?



ArshT View Post
But I'm not here to advertise AB. I just read TonyB's question followed by the misinformations by two users and wanted to give a reply.

Tony and I are still waiting for sample AB code to emulate the MC very basic system I displayed. Perhaps you have know idea. Your just very good at being rude to other people that do contribute.


Just to show I do know something about AB and it's capabilities. Here is a chart showing a System that I wrote and it is fully written in one Amibroker System file. No trying to get to special after the fact backtesting programming.
Again, I still don't know what the BackTesting, after the fact, software has to do with a live strategy.
Please register on futures.io to view futures trading content such as post attachment(s), image(s), and screenshot(s).


Oh, you want the code
 
Code
/*
//System3
//=================================
// NW 0903, AB 5.23, Status: Developmental
//
// This Script is for EDUCATIONAL PURPOSES ONLY.  It is NOT a TRADABLE SYSTEM.
// ---------------------------------------------------------------------------
//
// Futures System
//
// StopLoss    1.5 ATR 10
//        Population: ASX300, 1/7/02 - 30/6/07, Number of positions, Liquidity; all assumed
//        Trades assessed on the Close overnight, entries and exits on the Open next Bar
//        Standard brokerage (0.11%, $30 min, - E-Trade) and interest on cash (5%).
// Database  :     FTSE
// Objective :    FTSE
// Settings  :     FTSE
//
//
// Set Backtest Conditions
// =======================
// Set Starting Equity
*/
EqtSttAmt = 20000 ;            // Equity Start Amount
//

// ####  Defines market hours
//##########################################################
RequestTimedRefresh( 1 );
DOW = Now( 9 );//day of the week
WeekEnd = IIf( ( DOW == 1 OR DOW == 7 ), 1, 0 );

Time = TimeNum();
MarketOpen = 100000;//08:00:00;
MarketClose = 163000;//20:00:00 or 163000
MarketON = TimeNum() >= MarketOpen AND (Now( 4 ) < MarketClose) AND NOT WeekEnd;
MarketOFF = IIf(TimeNum() >= MarketClose,0,1) ;//day's over
Hhmod = frac( MArketclose / 10000 );

//
// Population and Position sizing
// ==============================
//
// Set Number of positions (as a % of Current Equity)
//PosOpnMax =  1 ;  //Optimize("NumPos", 10, 5, 15, 1) ; 
//PositionSize = 1 / PosOpnMax ;
PositionSize = MarginDeposit = 1;    // Required for trading futures contracts
//
// Set Population Minimum Turnover (Liquidity)
LiqMinCur = 400 ;  //Optimize("LiqMin-K", 400, 300, 1000, 50) ; 
LiqSmaPed = 20 ;
LiqActAmt = MA(C * V, LiqSmaPed) / 1000 ;
LiqActSwt = LiqActAmt > LiqMinCur ;


/* First we need to enable custom backtest procedure and 
** tell AmiBroker to use current formula 
*/ 

SetCustomBacktestProc(""); 

/* Now custom-backtest procedure follows */ 

if( Status("action") == actionPortfolio ) 
{ 
    bo = GetBacktesterObject(); 

    bo.Backtest(); // run default backtest procedure 

    st = bo.GetPerformanceStats(0); // get stats for all trades 

    // Expectancy calculation (the easy way) 
    // %Win * AvgProfit - %Los * AvgLos 
    // note that because AvgLos is already negative 
    // in AmiBroker so we are adding values instead of subtracting them 
    // we could also use simpler formula NetProfit/NumberOfTrades 
    // but for the purpose of illustration we are using more complex one :-) 
    expectancy = st.GetValue("WinnersAvgProfit")*st.GetValue("WinnersPercent")/100 + 
                st.GetValue("LosersAvgLoss")*st.GetValue("LosersPercent")/100; 

    // Here we add custom metric to backtest report 
    bo.AddCustomMetric( "Expectancy ($)", expectancy ); 
} 
//
// External Functions
// ==============================
//

function Pivot ()
{
    return (High+Low+Close)/3;
};


function PivotRibbon(PivotMA)
{
    Result=0;Uptrend=0;Dntrend=0;
    FastP=Pivot();
    SlowP=MA( FastP, PivotMA ); // Usally3
    Uptrend=IIf(FastP>SlowP,True,False);
    Dntrend=IIf(FastP<SlowP,True,False);
    Result = IIf( Uptrend,1,IIf( Dntrend,-1,0));
    return Result;
};

function PivotHist(SMAPeriods,PivotPeriods)
{
    P = ParamField("Price field",-1);
//    Periods  = Param("SMA Periods", SMAPeriods, 2, 300, 1, 10 );
//    PPeriods = Param("Pivot Periods", PivotPeriods, 2, 300, 1, 10 );
    Periods  = SMAPeriods;
    PPeriods = PivotPeriods;
    i = MA(P, Periods )-MA(Pivot(),PPeriods);
    return I ;
}

// ==========================================================================================
//
// Entry Conditions
// ================
//
// Optimise variables for Entry formula
//EntSmaSht = Optimize("EntSmaSht", 5, 3, 30, 1) ; //40
//EntSmaLng = Optimize("EntSmaLng", 8, 5, 30, 1) ; //110
//EntCrsSht = Optimize("EntCrsSht", 10, 2, 16, 2) ;
//EntCrsLng = Optimize("EntCrsLng", 16, 2, 16, 2) ;

//TrendFilter     = Optimize("MA Periods", 165, 5, 200, 5) ;
TrendFilter     = 165 ;

//EntSMAPeriods     = Optimize("SMA Periods", 11, 1, 20, 1) ;
//EntPivotPeriods     = Optimize("Pivot Periods", 12, 1, 20, 1) ;
//EntRibbon             = Optimize("Ribbon MA", 3, 1, 10, 1) ;
EntSMAPeriods     = 11 ;
EntPivotPeriods     = 12 ;
EntRibbon             = 2 ;

RiskAmount=Optimize("RiskAmount",Param("RiskAmount",10),5,30,1);
//RiskAmount=15;
//
// Generate a Buy Signal (Entry)
EntSigSwt = 
    (PivotRibbon(EntRibbon)==1)
    AND ((PivotHist(EntSMAPeriods,EntPivotPeriods) > 0) OR ((PivotHist(EntSMAPeriods,EntPivotPeriods) > Ref(PivotHist(EntSMAPeriods,EntPivotPeriods),-1))))
    AND V > Ref(V,-1)
    AND C > (H+L)/2
    AND MA(Close,TrendFilter) > Ref(MA(Close,TrendFilter),-1)
    AND (TimeNum() > 100000) AND (TimeNum() < 160000)
    //AND (DateNum()>1090518)
 ;

//IIf((PivotRibbon(3)==1) AND (PivotHist() > 0), BuySigInd=1,0);

//
// Sell signals (None in this model)
// ---------------------------------
//ExtSigSwt = Close < SAR(0.02,0.2 )  ;
ExtSigSwt = Close < MA(Close,8)  ;
Plot(MA(Close,8), "ESL", colorGreen, styleLine) ;

//
// Initial Stop Loss
//------------------                //    Number of Bars for ISL ATR 
IslAtrBar = 3;//IslAtrBar = Optimize("IslATRBars", 3, 3, 10, 1) ;
//IslAtrBar = 5 ;    

//    ATR Factor 
IslAtrFac = 2.6;//IslAtrFac = Optimize("IslAtrFac", 2.6, 0.4, 3, 0.2) ;
//IslAtrFac = 2.2 ;
//
// Trailing Stop Loss
// -------------------
//    Number of Bars for TSL ATR calc 
TslAtrBar = 3; //TslAtrBar = Optimize("TslAtrBar", 6, 3, 10, 1) ;
//TslAtrBar = 5 ;
//    ATR Factor 
TslAtrFac = 2 ;//TslAtrFac = Optimize("TslATRFac", 2.6, 1.0, 3, 0.2) ;
//TslAtrFac = 2.8 ;
//
// Trade Processing Loop
// =====================
//
// Set arrays to a starting condition
Buy = 0 ;
Sell = 0 ;
BuySigInd = 0 ;
SelSigInd = 0 ;
IslPntArr = Null ;
TslPntArr = Null ;
IslBarStp = 0 ;
TslBarStp = 0 ;
IslBarGap = IslAtrFac * ATR(IslAtrBar) ;
TslBarGap = TslAtrFac * ATR(TslAtrBar) ;
TrdBarCnt = 0 ;
TrdProfit = 0 ;
TrdEntry = 0;
Position = 0 ;
Free_Trade = 0;
Initial_Stop = 0;
HalfBreakEven = 0;
FullBreakEven = 0;
LossSigInd = 0 ;
TradeEntryPrice = 0;
HalfBreakEvenReached=0;

//
//
// Trade Processing Loop proper
for( i = 1 ; i < BarCount ; i++)
{
 if(i < BarCount -1) 
  {
    // Buy processing
   if( EntSigSwt[i] AND Position[i]==0 )// AND ! TslBarStp[i])// AND EntSigSwt[i-1])// AND TrdBarCnt[i+1] = 1)
    {     
        BuySigInd[i] = 1 ;
        Position[i+1] = 1 ;  // Entered Long Position
        Buy[i+1] = 1 ; 
        BuyPrice[i+1] = O[i+1] ;
        Initial_Stop[i+1]=BuyPrice[i+1]-RiskAmount;
        Free_trade[i]=0;
        TradeEntryPrice[i+1]=BuyPrice[i+1];
        TrdProfit[i+1]=Close[i+1]-BuyPrice[i+1];
        TrdBarCnt[i+1]=1;
        Initial_Stop[i]=BuyPrice[i+1]-RiskAmount;
        IslPntArr[i +1] = Initial_Stop[i] ;     // Update the ISL Line
        HalfBreakEvenReached[i]=0;
    }

    
    // Sell processing
    if(Position[i]==1)
    {
        if(Free_Trade[i]==1)
        { // Execute Trailing Stop
              TslPntArr[i +1] = TslPntArr[i +1] ;     // Update the TSL Line
            if(ExtSigSwt[i]) 
            {
                Sell[i +1] = 1 ;
                  SellPrice[i +1] = O[i + 1] ;
                SelSigInd[i]=1;
                // Clear_Static_Variables
                Position[i]=0;
                Free_trade[i]=Null;
            };

        }
        else
        {
            if( High[i]-RiskAmount>TradeEntryPrice[i])
            { // Free Trade - Adjust to breakeven point

                if(Initial_Stop[i] < TradeEntryPrice[i]) 
                {    
                    Initial_Stop[i]  = TradeEntryPrice[i];                    
                };
                IslPntArr[i]     = Initial_Stop[i] ;     //
                TslPntArr[i]     = Close[i] ;             // Update the ISL Line
                Free_Trade[i]    = 1;                    // Move onto trailing stop
                FullBreakEven[i] = 1;                    // Display Star
            }
            else
                if( High[i]-(RiskAmount/2)>TradeEntryPrice[i] AND HalfBreakEvenReached[i]==0)
                { // 1/2 point of a breakeven trade
                    HalfBreakEven[i]=1;
                    HalfBreakEvenReached[i]=1;
                    if(Initial_Stop[i] < (TradeEntryPrice[i]-(RiskAmount/2))) 
                    {    
                        Initial_Stop[i] = TradeEntryPrice[i]-(RiskAmount/2);
                    }; 
                    IslPntArr[i] = Initial_Stop[i] ; //
                }
                else
                    if( TrdBarCnt[i]>5)
                    { // Sideways Stop
                        if(Low[i]>Initial_Stop[i])
                        {
                            Initial_Stop[i] = Low[i] ;
                            IslPntArr[i] = Initial_Stop[i] ; //
                        }
                    };

            if(Close[i]<Initial_Stop[i] AND Initial_Stop[i]>TradeEntryPrice[i]) // Above Entry but sideways
            { // Exit due to either a time stop or a breach of the Initial stop
                Sell[i] = 1 ;
                  SellPrice[i] = Initial_Stop[i] ;
                LossSigInd[i]=1;
                Position[i]=0;
            }
            if(Low[i]<Initial_Stop[i] AND Initial_Stop[i]<TradeEntryPrice[i]) // Below Entry but sideways
            { // Exit due to either a time stop or a breach of the Initial stop
                Sell[i] = 1 ;
                  SellPrice[i] = Initial_Stop[i] ;
                SidewaysSigInd[i]=1;
                Position[i]=0;
            }
            if(TrdBarCnt[i]>72)
            { // Exit due to either a time stop or a breach of the Initial stop
                Sell[i] = 1 ;
                  SellPrice[i] = Initial_Stop[i] ;
                LossSigInd[i]=1;
                Position[i]=0;
            }
        }
    }
    // Somewhere between the Entry and the exit
    if( Position[i]==1 )
    {
//        IslBarStp[i +1] = C[i] - IslBarGap[i] ;
        IslBarStp[i +1] = IslBarStp[i] ;
        IslPntArr[i +1] = IslPntArr[i] ;     // Update the ISL Line
        TslBarStp[i +1] = C[i] - TslBarGap[i] ;
        TslPntArr[i+1]  = TslPntArr[i] ;    
        TrdEntry[i+1]   = O[i +1];
        TrdProfit[i+1]  = Close[i+1]-TradeEntryPrice[i];
        TrdBarCnt[i+1]  = TrdBarCnt[i] +1;
        Position[i+1]   = Position[i];
        Free_trade[i+1] = Free_trade[i];
        Initial_Stop[i+1] = Initial_Stop[i];
        HalfBreakEvenReached[i+1]=HalfBreakEvenReached[i];
        TradeEntryPrice[i+1] = TradeEntryPrice[i];
    }
  }
}
        
    


/*
    // Sell processing
   if(Position=1 AND (ExtSigSwt[i] OR C[i] < IslBarStp[i] OR C[i] < TslBarStp[i]) AND TslBarStp[i] > 0)
   {
        SelSigInd[i] = 1 ;
        if( i < BarCount -1)
        {

            TrdBarCnt[i +1] = TrdBarCnt[i] + 1 ;
           if(MarketOFF[i]==0)
            { 
                Sell[i +1] = 1 ;
                  SellPrice[i +1] = O[i + 1] ;
            }
            else
            {
                Sell[i +1] = 1 ;
                SellPrice[i +1] = O[i + 1] ;
            }
            StaticVarSet("Position",0);
        }
    } else  // Main Trade loop
        {
//               if((TslBarStp[i] > 0) OR (IslBarStp[i] > 0) AND (i < BarCount -1))
               if(Position=1 AND (i < BarCount -1))
               {  // Keep array up to date 
                TrdBarCnt[i +1] = TrdBarCnt[i] + 1 ;
                IslBarStp[i +1] = IslBarStp[i] ;
                TrdEntry[i +1]  = TrdEntry[i] ;

                TrdProfit[i+1] = Close[i+1]-TrdEntry[I+1]; // Update Trade Profit

                if(C[i+1] < (TrdEntry[i+1]+ RiskAmount[i+1])) 
                {  // Entry Cover 
                    //if(TrdProfit[i+1] > RiskAmount[i+1]/2)  
                    //    IslBarStp[i +1] = (TrdProfit[i+1] - RiskAmount[i+1])+TrdEntry[i+1];
                      //if(TslBarStp[i +1] < IslBarStp[i +1])
                        IslBarStp[i +1] =  Max(H[i +1] - TslBarGap[i +1], IslBarStp[i]) ;
                        IslPntArr[i +1] = IslBarStp[i +1] ;     // Update the ISL Line
                }
                else
                {      // Re calc trailing stop
                      TslBarStp[i +1] = Max(C[i +1] - TslBarGap[i +1], TslBarStp[i]) ; // Should be at least C if not H
                      //if(TslBarStp[i +1] > IslBarStp[i +1]) 
                          TslPntArr[i +1] = TslBarStp[i +1] ;        // Update the TSL Line
                }
               } 
        }
*/    

//
ToolTip=StrFormat(    "Position: %g", Position);
ToolTip=StrFormat(    "Free_Trade: %g", Free_Trade);
ToolTip=StrFormat(    "TradeEntryPrice: %g", TradeEntryPrice);
ToolTip=StrFormat(    "TrdProfit: %g", TrdProfit);
ToolTip=StrFormat(    "RiskAmount: %g\n", RiskAmount);
ToolTip=StrFormat(    "Initial_Stop: %g\n", Initial_Stop);


ToolTip=StrFormat(    "IslBarStp: %g", IslBarStp);
ToolTip=StrFormat(    "IslPntArr: %g\n", IslPntArr);
ToolTip=StrFormat(    "TslBarStp: %g", TslBarStp);
ToolTip=StrFormat(    "TslPntArr: %g\n", TslPntArr);

ToolTip=StrFormat(    "X: %g", C);
ToolTip=StrFormat(    "Y: %g\n", TrdEntry+ RiskAmount);


//ApplyStop( stopTypeNBar, stopModeBars, 2 ,1);  // Time Stop
//ApplyStop(stopTypeLoss, stopModePoint, 7.5,1,False );
//AddTextColumn( string, Name, format = 1.2, textColor = colorDefault, bkgndColor = colorDefault, width = -1 ) 
//AddTextColumn( Close, "Name", format = 1.2, colorRed, colorBlue,5 ) ;

//AddTextColumn( Group_id(1), "Name" ) ;
AddColumn(Buy, "Buy2", 1);



//
// Format Simple Chart
// ===================
GraphXSpace = 5 ;
PlotShapes(BuySigInd * shapeSmallUpTriangle, colorGreen, 0, Low - ATR(5)) ;
PlotShapes(SelSigInd * shapeSmallDownTriangle, colorRed, 0, High + ATR(5)) ;
PlotShapes(Buy * shapeUpArrow, colorGreen, 0, Low - ATR(5)) ;
PlotShapes(Sell * shapeDownArrow, colorRed, 0, High + ATR(5)) ;

PlotShapes(HalfBreakEven * shapeHollowStar, colorRed, 0, High + ATR(5)) ;
PlotShapes(FullBreakEven * shapeStar, colorRed, 0, High + ATR(5)) ;

PlotShapes(LossSigInd * shapeCircle, colorRed, 0, High + ATR(5)) ;
//PlotShapes(SidewaysSigInd * shapeSquare, colorRed, 0, High + ATR(5)) ;
//GraphZOrder = 2;
//PlotShapes(LossSigInd * 53, colorRed, 0, (High + Low+Close/3)) ;



//PlotText( "Sell\n@" + C, 0, H + ATR(10), colorRed, colorYellow ); 
Offset = High + ATR(10);
PlotText( "Sell\n@" + C, 0, Offset[0], colorRed, colorYellow ); 

//
Plot( C, "Price", colorBlack, styleCandle ) ;
//ToolTip=StrFormat(    "Open: %g\nHigh:  %g\nLow:   %g\nClose:  %g (%.1f%%)\nVolume:     %g\nPivot: %g\n", O, H, L, C,NumToStr( V, 1 ));//,1,2, SelectedValue( ROC( C, 1 )),Pivot());
ToolTip=StrFormat(    "Open: %g\nHigh:  %g\nLow:   %g\nClose:  %g (%.1f%%)\nPivot:     %g\nMarketoff:%6g\nTrdBarCnt:%6g\n", O, H, L, C,0,PivotRibbon(3),MarketOff,TrdBarCnt);
ToolTip=StrFormat(    "Buy %g\nBuyPrice: %g\nTrdProfit:  %g\nTrdEntry:   %g\nClose:  %g (%.1f%%)\nPivot:     %g\nMarketoff:%6g\nTrdBarCnt:%6g\n", Buy,BuyPrice, TrdProfit, TrdEntry, C,0,PivotRibbon(3),MarketOff,TrdBarCnt);
ToolTip=StrFormat(    "EntSigSwt %g\n", EntSigSwt);

ToolTip=StrFormat(    "TrdEntry: %g\n", TrdEntry);

//
Plot(IslPntArr, "ISL", colorBlue, styleLine) ;
Plot(TslPntArr, "TSL", colorRed, styleLine) ;
//
//Plot( MA( C, EntSmaSht ), "MA-Short", colorGreen, styleDashed); 
//Plot( MA( C, EntSmaLng ), "MA-Long", colorRed, styleDashed); 
//Plot( MA( C, EntCrsSht ), "MA-Cross", colorGreen, styleLine | styleThick); 
//Plot( MA( C, EntCrsLng ), "MA-Short", colorBlue, styleLine); 
//
// System Settings  
SetOption("InitialEquity", EqtSttAmt) ;        // Set Initial Equity
//SetOption("MaxOpenPositions", PosOpnMax) ;    // Maximum number of Open Positions 
SetOption("AllowPositionShrinking", False) ;    // Allow code to manage    
//
// System is Long Only
Short=Cover=0 ;
//

// General Settings & Options
// ===================

// Set Optimizer engine
OptimizerSetEngine("cmae") ;

SetOption("ExtraColumnsLocation",1);  // Put Custom Columns at the begining of the report

// END



Plot( 5, /* defines the height of the ribbon in percent of pane width
*/"Pivot Ribbon",
IIf( PivotRibbon(EntRibbon)==1, colorGreen, IIf( PivotRibbon(EntRibbon)==-1, colorRed, 0 )), /* choose color */
styleOwnScale|styleArea|styleNoLabel, -0.5, 100 );

_SECTION_END();

_SECTION_BEGIN("EMA");
P = ParamField("Price field",-1);
Periods = Param("Periods", 15, 2, 300, 1, 10 );
Plot( EMA( P, Periods ), _DEFAULT_NAME(), ParamColor( "Color", colorCycle ), ParamStyle("Style") ); 
_SECTION_END();

_SECTION_BEGIN("EMA1");
P = ParamField("Price field",-1);
Periods = Param("Periods", 15, 2, 300, 1, 10 );
Plot( EMA( P, Periods ), _DEFAULT_NAME(), ParamColor( "Color", colorCycle ), ParamStyle("Style") ); 
_SECTION_END();

_SECTION_BEGIN("EMA2");
P = ParamField("Price field",-1);
Periods = Param("Periods", 15, 2, 300, 1, 10 );
Plot( EMA( P, Periods ), _DEFAULT_NAME(), ParamColor( "Color", colorCycle ), ParamStyle("Style") ); 
_SECTION_END();
.
.
Back to you ArshT that is always right, yet unable to prove anything himself.

Neil.


Last edited by NW27; February 28th, 2012 at 12:36 AM.
The following 2 users say Thank You to NW27 for this post:
 
  #53 (permalink)
Go Bears!
Bay Area, CA - US
 
Futures Experience: Beginner
Platform: TOS, TS & MC
Broker/Data: TDA & TS
Favorite Futures: Stock, Options and now Futures (ES)
 
TonyB's Avatar
 
Posts: 514 since Dec 2010
Thanks: 227 given, 134 received


NW27, it's nice that you have experience with both, and I'm sure other platforms. You are in a better position to ask such questions than someone like myself...

If indeed some of the things you point-out are short-comings in AB, at least in relation to MC, might it simply be due to AB not being initially focused on futures, like MC? If so, then maybe we can expect improvements in this area, to where things are simplified with check boxes and radial buttons, like you just showed for MC. Or, do you think that there is an inherent flaw in AFL to where such things just cannot be made this simple?

 
  #54 (permalink)
Elite Member
Newcastle, Australia
 
Futures Experience: Intermediate
Platform: Multicharts 8 - Full Version
Broker/Data: IB
Favorite Futures: SPI,FTSE100, 6E, 6A
 
Posts: 285 since Oct 2010
Thanks: 108 given, 177 received

Hi Tony,
None of this specifically relates to futures. Many people who trade shares, Forex etc scale out of positions or wish to easily program their strategy to move from a trade with a StopLoss to a trade with a breakeven and then maybe sell half the position when they have reached a Reward to Risk ratio of 2 and let the rest run on a trailing stop.
The chart that I showed was all automatically done with AB and shows the various stages of the trade as it moved upwards. I have the same thing demonstrated in MC at https://futures.io/elite-circle/17409-so-whats-good-trailing-stop.html#post188201 You need to zoom in somewhat so that you can see the actual labels of the stop as it moves through it's various stages.

The learning curved required to do the same thing in Multicharts was a hell of a lot less. Just the way AB handles past data as a separate array is right right pain in the ass. But that's just me. As you can see, I can make AB sing but look at the code, it was bloody hard learning the song. However, compare the MC code in the various examples I have given you, to the AB code, ie the trailing stop. In actual fact, the MC code example of the trailing stop is really one line (last one) the rest is just fluff (dressing).

Where AB does have it over MC is in the pretty chart area. Ie you can shade charts etc.
But I'm here to make money not make things look pretty.

Neil.


Please register on futures.io to view futures trading content such as post attachment(s), image(s), and screenshot(s).

The following 3 users say Thank You to NW27 for this post:
 
  #55 (permalink)
Elite Member
Netherlands
 
Futures Experience: Advanced
Platform: Ensign, Multicharts
Favorite Futures: SP500
 
Posts: 95 since Nov 2009
Thanks: 66 given, 56 received

Very nicely done Neil, thanks.

Shows you really know what you are talking about !

 
  #56 (permalink)
Trading Apprentice
Asheville, North Carolina
 
Futures Experience: Advanced
Platform: AmiBroker, Dynamic Trader, Metastock, FreeStockCharts, TradingView
Favorite Futures: stocks, options
 
Posts: 24 since Sep 2010
Thanks: 1 given, 15 received


Big Mike View Post
I'm a discretionary trader that uses basically zero indicators, don't have time to learn a new platform and no need or desire for it.

Mike

Mike,

What do you mean by a "discretionary" trader. I'm also classify myself as a discretionary trader which to me means that I do not use a mechanical system but rather make decisions based on a variety of inputs provided by several programs. In the true spirit of a discretionary trader the inputs used are not fixed.

You also must use some type of input. What are the "non-indicator" things that you look at in order to make trading decisions? Perhaps volume or patterns or trendlines or cycles or ... ?

Bill

 
  #57 (permalink)
Membership Revoked
London England
 
Futures Experience: Advanced
Platform: Amibroker
Favorite Futures: Forex, Futures
 
Posts: 16 since Feb 2012
Thanks: 4 given, 6 received


NW27 View Post
More special programming, or in Multicharts, you could just tick a box and select minute or tick data. Also have a look at how you can use the Bid & Ask data to FULLY back test.


This just shows again how uninformed you are. Are you faking Andrew Kirillov himself? You can do and choose just the same in Amibroker if you would read the manual which you clearly haven't. Also using Bid and Ask is not a problem if you would have read the manual carefully.


NW27 View Post
I must be blind, I didn't see any reference in TJ's cut and pasted comment.

If you think you are blind I will take good care not to say anything against it. You are the expert here. lol


NW27 View Post
You've yet to show us how I'm wrong, in that within a system, I cannot tell whether I'm in a trade or not..


Your impatience is amazing. I really don't wanna see how you trade while being in that period


NW27 View Post
Simple to add slippage in MC. How many dollars would you like??? Again no special coding required.

Yeah I see that you have problems with coding, reading, researching yourself and so on


NW27 View Post
None of those links show me how to set a specific number of contracts to Buy or Sell at individual points or whether I'm in a trade, so that I can exit the remander on a ATR trailing stop or what ever.


I have thought you were a professional coder. Instead it seems you need every little detail shown to you from start to end of code. I hope you are able to write your own full name yourself.


NW27 View Post
Those links are all relating to trades that are looked at after the fact via the Backtester. Not whilst they are actually happening and price action calcs need to come into play and make decisions on getting In/Out

Again reading problems?
NW27 View Post
I wasn't trying to prove I was right or wrong, just a suggestion. You love to say people are wrong.

Which you clearly are. You stated stuff as facts that are wrong. In the same way as the posts by the other ignorant Mr. Clueless (No, not you TonyB).

NW27 View Post
Yeah right. When do I use a IF statement as opposed to a IFF statement? When do I use a global variable and when is it in the array of prices? Why do I need an array of prices?


Yeah I see that you have again problems with understanding simple things. But that's not my problem

NW27 View Post
Tony and I are still waiting for sample AB code to emulate the MC very basic system I displayed. Perhaps you have know idea. Your just very good at being rude to other people that do contribute.


Again why so impatient in one thread and even two times in one post? Are you like that while trading too? telling the truth by telling people being misinformed isn't the same as being rude.
NW27 View Post
Just to show I do know something about AB and it's capabilities. Here is a chart showing a System that I wrote and it is fully written in one Amibroker System file. No trying to get to special after the fact backtesting programming.
Again, I still don't know what the BackTesting, after the fact, software has to do with a live strategy.

This thread is not about backtesting? Do I have problems with reading and coding or does someone else have them? But please and I really beg you don't show me how you trade as well. I do not want to lose money. And again if you have problems with coding a strategy it's not one of my problems.
NW27 View Post
Oh, you want the code

No I don't. You want.


NW27 View Post
Back to you ArshT that is always right, yet unable to prove anything himself.

I never said I'm an expert. You seem to think you are although you are just an "expert". There is one thing you are a true expert in. That is in the field of misinformation. You want code? Ok just this time. And to avoid misinformtion by an "expert" like me I just add a pictured copy and paste of a reply of expert Tomasz Janezcko himself.


Last edited by ArshT; February 28th, 2012 at 02:42 PM.
 
  #58 (permalink)
Membership Revoked
London England
 
Futures Experience: Advanced
Platform: Amibroker
Favorite Futures: Forex, Futures
 
Posts: 16 since Feb 2012
Thanks: 4 given, 6 received

Big mike does not seem to like larger pics. Or it's my ad blocker. No matter what I can't see the uploaded pic in my last post so I just uploaded to a extern pic loader that actually works. http://img220.imageshack.us/img220/5787/codeforimpatientpeople.png

 
  #59 (permalink)
Membership Revoked
London England
 
Futures Experience: Advanced
Platform: Amibroker
Favorite Futures: Forex, Futures
 
Posts: 16 since Feb 2012
Thanks: 4 given, 6 received


TonyB View Post
NW27, it's nice that you have experience with both, and I'm sure other platforms. You are in a better position to ask such questions than someone like myself...

If indeed some of the things you point-out are short-comings in AB, at least in relation to MC, might it simply be due to AB not being initially focused on futures, like MC? If so, then maybe we can expect improvements in this area, to where things are simplified with check boxes and radial buttons, like you just showed for MC. Or, do you think that there is an inherent flaw in AFL to where such things just cannot be made this simple?

Wrong. He's just ignorant and clueless that's all.

 
  #60 (permalink)
Membership Revoked
London England
 
Futures Experience: Advanced
Platform: Amibroker
Favorite Futures: Forex, Futures
 
Posts: 16 since Feb 2012
Thanks: 4 given, 6 received


And another support reply
Quoting 
Hello,

Sure feel free to post. MC is pathetically slow when it comes to portfolio backtesting, from what I know it does not allow rotational trading at all,
the "MarketPosition" variable that this guy was talking about is TS legacy and a source of problems because it is NOT compatible with portfolio backtesting.

With AmiBroker, you can change the sizes of postions based on sizes of OTHER postions on OTHER symbols (see rebalancing example),
with "MarketPosition" being limited to current (one and only one) symbol, it is simply not possible to do.

http://www.amibroker.com/kb/2006/03/06/re-balancing-open-positions/

Bottom line, the "MarketPosition" variable that the MC user is so delighted is a LIMITATION, not a good thing.

As I wrote you, nobody who paid $1500 for software will ever admit that $199 software is better even facing hard facts. People will deny all arguments
just to rationalize their wrong decision.

Best regards,
Tomasz Janeczko
amibroker.com



Last edited by ArshT; February 28th, 2012 at 03:20 PM.

Closed Thread



futures io > > > > Backtesting and Research: MultiCharts or AmiBroker

Thread Tools Search this Thread
Search this Thread:

Advanced Search



Upcoming Webinars and Events (4:30PM ET unless noted)

Linda Bradford Raschke: Reading The Tape

Elite only

Adam Grimes: TBA

Elite only

NinjaTrader: TBA

January

Ran Aroussi: TBA

Elite only
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
VIDEO: MultiCharts vs. NinjaTrader strategy backtesting and optimization Big Mike MultiCharts 53 June 12th, 2016 02:34 PM
Backtesting identical strategy tradestation and multicharts different results crbucks MultiCharts 7 April 26th, 2012 08:30 AM
[NinjaTrader]    NinjaTrader and Amibroker excite Platforms and Indicators 3 June 10th, 2011 01:43 AM
Do we need to use the bar magnifier when backtesting/optimization in MultiCharts? benharrell MultiCharts 8 May 4th, 2011 01:17 AM
MultiCharts backtesting and spread arjfca The Elite Circle 3 September 26th, 2010 09:06 AM


All times are GMT -4. The time now is 07:10 AM.

Copyright © 2017 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, +507 833-9432, info@futures.io
All information is for educational use only and is not investment advice.
There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
no new posts
Page generated 2017-12-13 in 0.19 seconds with 20 queries on phoenix via your IP 54.196.182.102