本帖最後由 skyler 於 14-5-23 09:16 編輯
k大您好
想跟您確認一下我的想法是否正確
以下我的測試CODE
_SECTION_BEGIN( "Product Settings" );
SetPositionSize( 1 , spsShares );
SetOption( "MaxOpenPositions" , 1 );
SetOption( "InitialEquity" , 10000 );
SetOption( "FuturesMode" , 1 );
SetOption( "CommissionMode" , 3 );
SetOption( "CommissionAmount" , 6.5 );
RoundLotSize = 1;
//澳幣
if ( Name () == "6A #F" )
{
TickSize = 0.0001 ;
MarginDeposit = 2035 ;
PS = 10000;
PointValue = 10 * PS;
}
//加幣
if ( Name () == "6C #F" )
{
TickSize = 0.0001 ;
MarginDeposit = 1265 ;
PS = 10000;
PointValue = 10 * PS;
}
//歐元
if ( Name () == "6E #F" )
{
TickSize = 0.0001 ;
MarginDeposit = 2475 ;
PS = 10000;
PointValue = 12.5 * PS;
}
//日幣
if ( Name () == "6J #F" )
{
TickSize = 0.0001 ;
MarginDeposit = 3465 ;
PS = 10000;
PointValue = 12.5 * PS;
}
//瑞郎
if ( Name () == "6S #F" )
{
TickSize = 0.0001 ;
MarginDeposit = 2530 ;
PS = 10000;
PointValue = 12.5 * PS;
}
//輕原油
if ( Name () == "CL #F=1" )
{
TickSize = 0.01 ;
MarginDeposit = 3190 ;
PS = 100;
PointValue = 10 * PS;
}
//emini S&P
if ( Name () == "ES #F" )
{
TickSize = 0.25 ;
MarginDeposit = 4758 ;
PS = 100;
PointValue = 0.5 * PS;
}
//黃金
if ( Name () == "GC #F=1" )
{
TickSize = 0.1 ;
MarginDeposit = 7150 ;
PS = 10;
PointValue = 10 * PS;
}
//天然氣
if ( Name () == "NG #F=1" )
{
TickSize = 0.001 ;
MarginDeposit = 3135 ;
PS = 1000;
PointValue = 10 * PS;
}
//白銀
if ( Name () == "SI #F=1" )
{
TickSize = 0.005 ;
MarginDeposit = 9900 ;
PS = 1000;
PointValue = 5 * PS;
}
//小道瓊
if ( Name () == "YM #F" )
{
TickSize = 1 ;
MarginDeposit = 3575 ;
PS = 1;
PointValue = 5 * PS;
}
//玉米
if ( Name () == "ZC #F" )
{
TickSize = 0.25 ;
MarginDeposit = 2025 ;
PS = 100;
PointValue = 0.5 * PS;
}
//黃豆
if ( Name () == "ZS #F" )
{
TickSize = 0.25 ;
MarginDeposit = 4050 ;
PS = 100;
PointValue = 0.5 * PS;
}
//小麥
if ( Name () == "ZW #F" )
{
TickSize = 0.25 ;
MarginDeposit = 2025 ;
PS = 100;
PointValue = 0.5 * PS;
}
_SECTION_END();
MA5_P1 = Ref( MA( C, 5 ), -1 );
MA5_P2 = Ref( MA( C, 5 ), -2 );
Cond_MA5_Buy = MA5_P1 > MA5_P2;
Cond_MA5_Sell = MA5_P1 < MA5_P2;
Cross5_Buy = Cross ( Ref( C, -1 ), MA5_P1 );
Cross5_Sell = Cross ( MA5_P1, Ref( C, -1 ) );
Buy = Cond_MA5_Buy AND Cross5_Buy ;
Sell = Cross5_Sell;
Short = Cond_MA5_Sell AND Cross5_Sell ;
Cover = Cond_MA5_Buy ;
Buy = ExRem( Buy, Short );
Short = ExRem( Short, Buy );
Cover = ExRem( Cover , Sell );
Sell = ExRem( Sell , Cover );
BuyPrice = CoverPrice = O;
ShortPrice = SellPrice = O;
AlertIf( Buy, "EMAIL", "Buy " + Name() + " at " + BuyPrice, 1 );
AlertIf( Sell, "EMAIL", "Sell " + Name() + " at " + SellPrice, 2 );
AlertIf( Short, "EMAIL", "Short " + Name() + " at " + ShortPrice, 3 );
AlertIf( Cover, "EMAIL", "Cover " + Name() + " at " + CoverPrice, 4 );
1.
在實際做SCAN下單時
從最上面的
_SECTION_BEGIN( "Product Settings" );
到
_SECTION_END();
裡面的所有內容
是否都應該刪除或是註解掉
不要寫在程式中
因為這些只有在回測時才會用
實際的情況下是沒用的
不知我理解對嗎?!
2.
Buy = ExRem( Buy, Short );
Short = ExRem( Short, Buy );
Cover = ExRem( Cover , Sell );
Sell = ExRem( Sell , Cover );
在實際交易中是有作用的嗎?!
3.
AlertIf 寫在最末端是否會有問題?
感謝您的回覆
|