您現(xiàn)在的位置:程序化交易>> 期貨公式>> 交易開拓者(TB)>> 開拓者公式>>正文內(nèi)容

開拓者左右互博 日內(nèi)隨機(jī)交易策略源碼[開拓者公式]

開拓者左右互博 日內(nèi)隨機(jī)交易策略源碼

//------------------------------------------------------------------------
// 簡稱: LeftRightTrading
// 名稱: LeftRightTrading
// 類別: 公式應(yīng)用
// 類型: 用戶應(yīng)用
//------------------------------------------------------------------------
Params
        Bool bInitStatus(False);
    Numeric InitMyRealMP(0);
    Numeric InitPreMyRealMP(0);
        Numeric FirstGrid(5);
        Numeric TotalGrids(10);
        Numeric GridInterval(5);
        Numeric WinGrid(5);
        Numeric EveryLots(1);
        Numeric OffSet(1);
       
        Numeric StyleChangeGrid(3);
        Bool ProgramTest(False);//是否測試 True 是 False 實(shí)盤
       
Vars
        NumericSeries MidLine;
        Numeric MinPoint;
        Numeric AskLine;
        Numeric BidLine;
        Numeric RealMidLine;
        Numeric MyRealMP(0);
        Numeric TmpGridIndex;
        Numeric qcbz;
        Bool TradeTime;
        Numeric TmpLots;
        Numeric PreRealMidLine;
        Numeric PreMyRealMP;
        Numeric MyBuyPosition;
        Numeric MySellPosition;
        Numeric EndTime;
        Bool        bJudgeTime;       
        Numeric ExitOnCloseMins(14.58);
       
        //Debug
        String FilePath;
       
Begin
        If((Weekday()!=5)&&(Weekday()!=6)&&(Weekday()!=7)){EndTime=0.151500;ExitOnCloseMins=15.13;}
        If(Weekday()==5){EndTime=0.150000;ExitOnCloseMins=14.58;}
        If(!ProgramTest)TradeTime=(Q_LastTime>=0.091500 And CurrentTime>0.091500 And CurrentTime<0.113000) Or (CurrentTime>0.130000 And CurrentTime<EndTime);
        If(ProgramTest)TradeTime=(CurrentTime>0.091500 And CurrentTime<0.113000) Or (CurrentTime>0.130000 And CurrentTime<EndTime);
       
        FilePath="C:\\LeftRightTrading_ea.txt";
       
        MyRealMP=GetGlobalVar(0);
        qcbz=GetGlobalVar(1);
        PreRealMidLine=GetGlobalVar(2);
        PreMyRealMP=GetGlobalVar(3);
        If(BarStatus==0 And (MyRealMP==InvalidNumeric || bInitStatus))
        {
                //If(A_BuyPosition>0)MyRealMP=A_BuyPosition;
                //Else If(A_SellPosition>0)MyRealMP=-1*A_SellPosition;
                //Else MyRealMP=InitMyRealMP;
                MyRealMP=InitMyRealMP;
                PreMyRealMP=InitPreMyRealMP;
               
        }
       
        If((Weekday()!=5)&&(Weekday()!=6)&&(Weekday()!=7))
                bJudgeTime=(Time==0.091500 Or Time==0.092500 Or Time==0.093500 Or Time==0.094500 Or Time==0.095500 Or Time==0.100500 Or Time==0.101500 Or Time==0.102500 Or Time==0.103500 Or Time==0.104500 Or Time==0.105500 Or Time==0.110500 Or Time==0.111500 Or Time==0.112500 Or Time==0.130000  Or Time==0.131000  Or Time==0.132000  Or Time==0.133000 Or Time==0.134000 Or Time==0.135000 Or Time==0.140000 Or Time==0.141000 Or Time==0.142000 Or Time==0.14300 Or Time==0.144000 Or Time==0.145000 Or Time==0.150000 Or Time==0.151000);
        If(Weekday()==5)
                bJudgeTime=(Time==0.091500 Or Time==0.092500 Or Time==0.093500 Or Time==0.094500 Or Time==0.095500 Or Time==0.100500 Or Time==0.101500 Or Time==0.102500 Or Time==0.103500 Or Time==0.104500 Or Time==0.105500 Or Time==0.110500 Or Time==0.111500 Or Time==0.112500 Or Time==0.130000  Or Time==0.131000  Or Time==0.132000  Or Time==0.133000 Or Time==0.134000 Or Time==0.135000 Or Time==0.140000 Or Time==0.141000 Or Time==0.142000 Or Time==0.14300 Or Time==0.144000 Or Time==0.145000);
        If(bJudgeTime)
        {
                MidLine=Open;
                PreRealMidLine=MidLine[1];
        }
        Else
        {
                MidLine=MidLine[1];
        }
        RealMidLine=MidLine;
        MinPoint=MinMove*PriceScale;
        If(!ProgramTest)AskLine=Q_AskPrice;Else AskLine=High;
        If(!ProgramTest)BidLine=Q_BidPrice;Else BidLine=Low;
        If(!ProgramTest)MyBuyPosition=A_BuyPosition;
        If(!ProgramTest)MySellPosition=A_SellPosition;
       
               
        If(BarStatus==2 && A_AccountID!="" && TradeTime)
        {
                If(Q_AskPrice<=0 || Q_BidPrice<=0) Return;
                If(Q_BidPrice==Q_UpperLimit || Q_AskPrice ==Q_LowerLimit) Return;
                If(High==Low)Return;
                If((Weekday()!=5)&&(Weekday()!=6)&&(Weekday()!=7))
                        bJudgeTime=(Time==0.091500 Or Time==0.092500 Or Time==0.093500 Or Time==0.094500 Or Time==0.095500 Or Time==0.100500 Or Time==0.101500 Or Time==0.102500 Or Time==0.103500 Or Time==0.104500 Or Time==0.105500 Or Time==0.110500 Or Time==0.111500 Or Time==0.112500 Or Time==0.130000  Or Time==0.131000  Or Time==0.132000  Or Time==0.133000 Or Time==0.134000 Or Time==0.135000 Or Time==0.140000 Or Time==0.141000 Or Time==0.142000 Or Time==0.14300 Or Time==0.144000 Or Time==0.145000 Or Time==0.150000 Or Time==0.151000);
               
                If(Weekday()==5)
                        bJudgeTime=(Time==0.091500 Or Time==0.092500 Or Time==0.093500 Or Time==0.094500 Or Time==0.095500 Or Time==0.100500 Or Time==0.101500 Or Time==0.102500 Or Time==0.103500 Or Time==0.104500 Or Time==0.105500 Or Time==0.110500 Or Time==0.111500 Or Time==0.112500 Or Time==0.130000  Or Time==0.131000  Or Time==0.132000  Or Time==0.133000 Or Time==0.134000 Or Time==0.135000 Or Time==0.140000 Or Time==0.141000 Or Time==0.142000 Or Time==0.14300 Or Time==0.144000 Or Time==0.145000);
                //FileAppend(FilePath,"bJudgeTime=");
               
                If(TradeTime)//定時(shí)清倉,重置中線值
                {
                        If(qcbz==1)
                        {
                                //FileAppend(FilePath,"Excute qcbz=1!  "+", MyRealMP="+Text(MyRealMP)+", MySellPosition="+Text(MySellPosition)+", MyBuyPosition="+Text(MyBuyPosition)+", PreMyRealMP="+Text(PreMyRealMP)+", A_SellProfitLoss="+Text(A_SellProfitLoss)+", A_BuyProfitLoss="+Text(A_BuyProfitLoss));
                                If(MySellPosition>0 And MyRealMP>0 And A_SellProfitLoss>0)
                                {
                                        TmpLots=MySellPosition;
                                        A_SendOrder(Enum_Buy,Enum_Exit,TmpLots,Q_AskPrice+OffSet*MinPoint);
                                        If(PreMyRealMP>0)MyRealMP=MyRealMP+PreMyRealMP-IntPart(TmpLots/EveryLots);
                                        Else If (PreMyRealMP<=0 And MyRealMP>0)MyRealMP=MyRealMP-IntPart(TmpLots/EveryLots);
                                        MySellPosition=MySellPosition-TmpLots;
                                }
                                If(MyBuyPosition>0 And MyRealMP<0 And A_BuyProfitLoss>0)
                                {
                                        TmpLots=MyBuyPosition;
                                        A_SendOrder(Enum_Sell,Enum_Exit,TmpLots,Q_BidPrice-OffSet*MinPoint);
                                        If(PreMyRealMP<0)MyRealMP=MyRealMP+PreMyRealMP+IntPart(TmpLots/EveryLots);
                                        Else If (PreMyRealMP>=0)MyRealMP=MyRealMP+IntPart(TmpLots/EveryLots);
                                        MyBuyPosition=MyBuyPosition-TmpLots;
                                } // cxh99.com

                                If(MySellPosition>0 And PreMyRealMP>0)
                                {
                                        TmpLots=Min(MySellPosition,PreMyRealMP*EveryLots);
                                        A_SendOrder(Enum_Buy,Enum_Exit,TmpLots,Q_AskPrice+OffSet*MinPoint);
                                        MyRealMP=MyRealMP+PreMyRealMP-IntPart(TmpLots/EveryLots);
                                        MySellPosition=MySellPosition-TmpLots;
                                }
                                If(MyBuyPosition>0 And PreMyRealMP<0)
                                {
                                        TmpLots=Min(MyBuyPosition,-1*PreMyRealMP*EveryLots);
                                        A_SendOrder(Enum_Sell,Enum_Exit,TmpLots,Q_BidPrice-OffSet*MinPoint);
                                        MyRealMP=MyRealMP+PreMyRealMP+IntPart(TmpLots/EveryLots);
                                        MyBuyPosition=MyBuyPosition-TmpLots;
                                }
                                PreMyRealMP=MyRealMP;
                                MyRealMP=0;
                                qcbz=0;
                               
                        }
                        Else {qcbz=1;}
                       
                        If(CurrentTime<ExitOnCloseMins/100 And qcbz!=0)
                        {
                                //FileAppend(FilePath,"Excute1!  "+"PreMyRealMP="+Text(PreMyRealMP)+"MySellPosition="+Text(MySellPosition)+"MyBuyPosition="+Text(MyBuyPosition));
                               
                                If(MySellPosition>0 And PreMyRealMP>0)
                                {
                                        TmpGridIndex=Abs(BidLine-PreRealMidLine)/(GridInterval*MinPoint);
                                        FileAppend(FilePath,"TmpGridIndex1="+Text(TmpGridIndex));
                                        If(TmpGridIndex>=StyleChangeGrid+1 And AskLine>PreRealMidLine+FirstGrid*MinPoint)
                                        {
                                                TmpLots=Min(MySellPosition,PreMyRealMP*EveryLots);
                                                A_SendOrder(Enum_Buy,Enum_Exit,TmpLots,Q_AskPrice+OffSet*MinPoint);
                                                PreMyRealMP=PreMyRealMP-IntPart(TmpLots/EveryLots);
                                        }
                                        TmpGridIndex=Abs(PreRealMidLine-AskLine)/(GridInterval*MinPoint);
                                        FileAppend(FilePath,"TmpGridIndex2="+Text(TmpGridIndex));
                                        If(TmpGridIndex<=StyleChangeGrid And AskLine<PreRealMidLine-FirstGrid*MinPoint)
                                        {
                                                TmpLots=Min(MySellPosition,PreMyRealMP*EveryLots);
                                                A_SendOrder(Enum_Buy,Enum_Exit,TmpLots,Q_AskPrice+OffSet*MinPoint);
                                                PreMyRealMP=PreMyRealMP-IntPart(TmpLots/EveryLots);
                                        }
                                       
                                }
                                Else If(MyBuyPosition>0 And PreMyRealMP<0)
                                {
                                        TmpGridIndex=Abs(BidLine-PreRealMidLine)/(GridInterval*MinPoint);
                                        FileAppend(FilePath,"TmpGridIndex3="+Text(TmpGridIndex));
                                        If(TmpGridIndex<=StyleChangeGrid And BidLine>PreRealMidLine+FirstGrid*MinPoint)
                                        {
                                                TmpLots=Min(MyBuyPosition,-1*PreMyRealMP*EveryLots);
                                                A_SendOrder(Enum_Sell,Enum_Exit,TmpLots,Q_BidPrice-OffSet*MinPoint);
                                                PreMyRealMP=PreMyRealMP+IntPart(TmpLots/EveryLots);
                                        }
                                        TmpGridIndex=Abs(PreRealMidLine-AskLine)/(GridInterval*MinPoint);
                                        FileAppend(FilePath,"TmpGridIndex4="+Text(TmpGridIndex));
                                        If(TmpGridIndex>=StyleChangeGrid And BidLine<PreRealMidLine-FirstGrid*MinPoint)
                                        {
                                                TmpLots=Min(MyBuyPosition,-1*PreMyRealMP*EveryLots);
                                                A_SendOrder(Enum_Sell,Enum_Exit,TmpLots,Q_BidPrice-OffSet*MinPoint);
                                                PreMyRealMP=PreMyRealMP+IntPart(TmpLots/EveryLots);
                                        }
                                }
                                If(PreMyRealMP>0 And AskLine>PreRealMidLine-FirstGrid*MinPoint And MySellPosition>0 )
                                {
                                        TmpGridIndex=Abs(AskLine-PreRealMidLine)/(GridInterval*MinPoint);
                                        FileAppend(FilePath,"TmpGridIndex5="+Text(TmpGridIndex));
                                        If(TmpGridIndex<=PreMyRealMP-1 And TmpGridIndex<=StyleChangeGrid)
                                        {
                                                PreMyRealMP=PreMyRealMP-1;
                                                A_SendOrder(Enum_Buy,Enum_Exit,EveryLots,Q_AskPrice+OffSet*MinPoint);
                                        }
                                }
                                Else If(PreMyRealMP<0 And BidLine<PreRealMidLine+FirstGrid*MinPoint And MyBuyPosition>0 )
                                {
                                        TmpGridIndex=Abs(PreMyRealMP-BidLine)/(GridInterval*MinPoint);
                                        FileAppend(FilePath,"TmpGridIndex6="+Text(TmpGridIndex));
                                        If(-1*TmpGridIndex>=PreMyRealMP+1 And TmpGridIndex<=StyleChangeGrid)
                                        {
                                                PreMyRealMP=PreMyRealMP+1;
                                                A_SendOrder(Enum_Sell,Enum_Exit,EveryLots,Q_BidPrice-OffSet*MinPoint);
                                        }
                                }
                               
                               
                               
                                If(PreMyRealMP<0 And BidLine>PreRealMidLine+FirstGrid*MinPoint And MyBuyPosition>0 )
                                {
                                        TmpGridIndex=Abs(BidLine-MinPoint-PreRealMidLine)/(GridInterval*MinPoint);
                                        FileAppend(FilePath,"TmpGridIndex7="+Text(TmpGridIndex));
                                        If(TmpGridIndex<=-1*PreMyRealMP-1 And TmpGridIndex>=StyleChangeGrid)
                                        {
                                                PreMyRealMP=PreMyRealMP+1;
                                                A_SendOrder(Enum_Sell,Enum_Exit,EveryLots,Q_BidPrice-OffSet*MinPoint);
                                        }
                                }
                                Else If(PreMyRealMP>0 And AskLine<PreRealMidLine-FirstGrid*MinPoint And MySellPosition>0 )
                                {
                                        TmpGridIndex=Abs(PreMyRealMP-AskLine+MinPoint)/(GridInterval*MinPoint);
                                        FileAppend(FilePath,"TmpGridIndex8="+Text(TmpGridIndex));
                                        If(TmpGridIndex>=PreMyRealMP-1 And TmpGridIndex>=StyleChangeGrid)
                                        {
                                                PreMyRealMP=PreMyRealMP-1;
                                                A_SendOrder(Enum_Buy,Enum_Exit,EveryLots,Q_AskPrice+OffSet*MinPoint);
                                        }
                                }
                               
                                If(MySellPosition>0 And MyRealMP>0)
                                {
                                        TmpGridIndex=Abs(BidLine-RealMidLine)/(GridInterval*MinPoint);
                                        FileAppend(FilePath,"TmpGridIndex9="+Text(TmpGridIndex));
                                        If(TmpGridIndex>=StyleChangeGrid+1 And AskLine>RealMidLine+FirstGrid*MinPoint)
                                        {
                                                TmpLots=Min(MySellPosition,MyRealMP*EveryLots);
                                                A_SendOrder(Enum_Buy,Enum_Exit,TmpLots,Q_AskPrice+OffSet*MinPoint);
                                                MyRealMP=MyRealMP-IntPart(TmpLots/EveryLots);
                                        }
                                        TmpGridIndex=Abs(RealMidLine-AskLine)/(GridInterval*MinPoint);
                                        FileAppend(FilePath,"TmpGridIndex10="+Text(TmpGridIndex));
                                        If(TmpGridIndex<=StyleChangeGrid And AskLine<RealMidLine-FirstGrid*MinPoint)
                                        {
                                                TmpLots=Min(MySellPosition,MyRealMP*EveryLots);
                                                A_SendOrder(Enum_Buy,Enum_Exit,TmpLots,Q_AskPrice+OffSet*MinPoint);
                                                MyRealMP=MyRealMP-IntPart(TmpLots/EveryLots);
                                        }
                                }///來源: www.tumamayizhan.com QQ 1145508240

                                Else If(MyBuyPosition>0 And MyRealMP<0)
                                {
                                        TmpGridIndex=Abs(BidLine-RealMidLine)/(GridInterval*MinPoint);
                                        FileAppend(FilePath,"TmpGridIndex11="+Text(TmpGridIndex));
                                        If(TmpGridIndex<=StyleChangeGrid And BidLine>RealMidLine+FirstGrid*MinPoint)
                                        {
                                                TmpLots=Min(MyBuyPosition,-1*MyRealMP*EveryLots);
                                                A_SendOrder(Enum_Sell,Enum_Exit,TmpLots,Q_BidPrice-OffSet*MinPoint);
                                                MyRealMP=MyRealMP+IntPart(TmpLots/EveryLots);
                                        }
                                        TmpGridIndex=Abs(RealMidLine-AskLine)/(GridInterval*MinPoint);
                                        FileAppend(FilePath,"TmpGridIndex12="+Text(TmpGridIndex));
                                        If(TmpGridIndex>=StyleChangeGrid+1 And BidLine<RealMidLine-FirstGrid*MinPoint)
                                        {
                                                TmpLots=Min(MyBuyPosition,-1*MyRealMP*EveryLots);
                                                A_SendOrder(Enum_Sell,Enum_Exit,TmpLots,Q_BidPrice-OffSet*MinPoint);
                                                MyRealMP=MyRealMP+IntPart(TmpLots/EveryLots);
                                        }
                                }
                                                               
                                If(MyRealMP>0 And AskLine>RealMidLine-FirstGrid*MinPoint And MySellPosition>0)
                                {
                                        TmpGridIndex=Abs(AskLine-RealMidLine)/(GridInterval*MinPoint);
                                        FileAppend(FilePath,"TmpGridIndex13="+Text(TmpGridIndex));
                                        If(TmpGridIndex<=MyRealMP-1 And TmpGridIndex<=StyleChangeGrid)
                                        {
                                                MyRealMP=MyRealMP-1;
                                                A_SendOrder(Enum_Buy,Enum_Exit,TmpLots,Q_AskPrice+OffSet*MinPoint);
                                                MyRealMP=MyRealMP-IntPart(TmpLots/EveryLots);
                                        }
                                       
                                }
                                Else If(MyRealMP<0 And BidLine<RealMidLine+FirstGrid*MinPoint And MyBuyPosition>0)
                                {
                                        TmpGridIndex=Abs(RealMidLine-BidLine)/(GridInterval*MinPoint);
                                        FileAppend(FilePath,"TmpGridIndex14="+Text(TmpGridIndex));
                                        If(-1*TmpGridIndex>=MyRealMP+1 And TmpGridIndex<=StyleChangeGrid)
                                        {
                                                MyRealMP=MyRealMP+1;
                                                A_SendOrder(Enum_Sell,Enum_Exit,TmpLots,Q_BidPrice-OffSet*MinPoint);
                                                MyRealMP=MyRealMP+IntPart(TmpLots/EveryLots);
                                        }
                                }                       
                               
                                If(MyRealMP>0 And AskLine<RealMidLine-FirstGrid*MinPoint And MySellPosition>0)
                                {
                                        TmpGridIndex=Abs(RealMidLine-AskLine+MinPoint)/(GridInterval*MinPoint);
                                        FileAppend(FilePath,"TmpGridIndex15="+Text(TmpGridIndex));
                                        If(TmpGridIndex<=MyRealMP-1 And TmpGridIndex>=StyleChangeGrid)
                                        {
                                                MyRealMP=MyRealMP-1;
                                                A_SendOrder(Enum_Buy,Enum_Exit,TmpLots,Q_AskPrice+OffSet*MinPoint);
                                                MyRealMP=MyRealMP-IntPart(TmpLots/EveryLots);
                                        }                                       
                                }
                                Else If(MyRealMP<0 And BidLine>RealMidLine+FirstGrid*MinPoint And MyBuyPosition>0)
                                {
                                        TmpGridIndex=Abs(BidLine-MinPoint-RealMidLine)/(GridInterval*MinPoint);
                                        FileAppend(FilePath,"TmpGridIndex16="+Text(TmpGridIndex));
                                        If(TmpGridIndex<=-1*MyRealMP-1 And TmpGridIndex>=StyleChangeGrid)
                                        {
                                                MyRealMP=MyRealMP+1;
                                                A_SendOrder(Enum_Sell,Enum_Exit,TmpLots,Q_BidPrice-OffSet*MinPoint);
                                        }
                                }
                               
                                // www.tumamayizhan.com **********************************************************
                                //FileAppend(FilePath,"Excute***!  "+", MyRealMP="+Text(MyRealMP)+", BidLine="+Text(BidLine)+", RealMidLine="+Text(RealMidLine)+", FirstGrid="+Text(FirstGrid)+", MinPoint="+Text(MinPoint)+", AskLine="+Text(AskLine)+", TmpGridIndex="+Text(TmpGridIndex));
                                If(MyRealMP>=0 And BidLine>=RealMidLine+FirstGrid*MinPoint)
                                {                                       
                                        TmpGridIndex=Abs(BidLine-RealMidLine)/(GridInterval*MinPoint);
                                        FileAppend(FilePath,"TmpGridIndex17="+Text(TmpGridIndex)+"MyRealMP="+Text(MyRealMP)+"TotalGrids="+Text(TotalGrids)+"StyleChangeGrid="+Text(StyleChangeGrid));
                                        If(TmpGridIndex>=MyRealMP+1 And MyRealMP<TotalGrids And TmpGridIndex<=StyleChangeGrid)
                                        {
                                                MyRealMP=MyRealMP+1;
                                                A_SendOrder(Enum_Sell,Enum_Entry,TmpLots,Q_BidPrice-OffSet*MinPoint);
                                                MyRealMP=MyRealMP-IntPart(TmpLots/EveryLots);
                                        }                                       
                                }
                                Else If(MyRealMP<=0 And AskLine<=RealMidLine-FirstGrid*MinPoint And MyBuyPosition>0)
                                {
                                        FileAppend(FilePath, "TmpGridIndex18="+Text(TmpGridIndex)+"MyRealMP="+Text(MyRealMP)+"TotalGrids="+Text(TotalGrids)+"StyleChangeGrid="+Text(StyleChangeGrid));
                                        TmpGridIndex=Abs(RealMidLine-AskLine)/(GridInterval*MinPoint);
                                        If(TmpGridIndex>=-1*MyRealMP+1 And -1*MyRealMP<TotalGrids And TmpGridIndex<=StyleChangeGrid)
                                        {
                                                MyRealMP=MyRealMP-1;
                                                A_SendOrder(Enum_Buy,Enum_Entry,TmpLots,Q_AskPrice+OffSet*MinPoint);
                                        }
                                }
                               
                               
                               
                                If(MyRealMP<=0 And BidLine>RealMidLine+FirstGrid*MinPoint)
                                {
                                        TmpGridIndex=Abs(BidLine-RealMidLine)/(GridInterval*MinPoint);
                                        FileAppend(FilePath,"TmpGridIndex19="+Text(TmpGridIndex)+"MyRealMP="+Text(MyRealMP)+"TotalGrids="+Text(TotalGrids)+"StyleChangeGrid="+Text(StyleChangeGrid));
                                        If(TmpGridIndex>=-1*MyRealMP+1 And -1*MyRealMP<TotalGrids And TmpGridIndex>=StyleChangeGrid)
                                        {
                                                MyRealMP=MyRealMP-1;
                                                A_SendOrder(Enum_Buy,Enum_Entry,TmpLots,Q_AskPrice+OffSet*MinPoint);
                                                MyRealMP=MyRealMP-IntPart(TmpLots/EveryLots);
                                        }                                        
                                }
                                Else If(MyRealMP>=0 And AskLine<RealMidLine-FirstGrid*MinPoint And MyBuyPosition>0)
                                {
                                        TmpGridIndex=Abs(RealMidLine-AskLine)/(GridInterval*MinPoint);
                                        FileAppend(FilePath,"TmpGridIndex20="+Text(TmpGridIndex)+"MyRealMP="+Text(MyRealMP)+"TotalGrids="+Text(TotalGrids)+"StyleChangeGrid="+Text(StyleChangeGrid));
                                        If(TmpGridIndex>=MyRealMP+1 And MyRealMP<TotalGrids And TmpGridIndex>=StyleChangeGrid+1)
                                        {
                                                MyRealMP=MyRealMP+1;
                                                A_SendOrder(Enum_Sell,Enum_Entry,TmpLots,Q_BidPrice-OffSet*MinPoint);
                                        }
                                }
                                //****************************************************************
                               
                        }
                        Else If(CurrentTime>ExitOnCloseMins/100)
                        {
                                If(MySellPosition>0)
                                {
                                        A_SendOrder(Enum_Buy,Enum_Exit,MySellPosition, Q_AskPrice+OffSet*MinPoint);
                                }
                                Else If(MyBuyPosition>0)
                                {
                                        A_SendOrder(Enum_Sell,Enum_Exit,MyBuyPosition, Q_BidPrice-OffSet*MinPoint);
                                }
                                MyRealMP=0;
                                PreMyRealMP=0;
                        }
                }
                //Else FileAppend(FilePath,"Not Trading Time.***");
               
                SetGlobalVar(0,MyRealMP);
                SetGlobalVar(1,qcbz);
                SetGlobalVar(2,PreRealMidLine);
                SetGlobalVar(3,PreMyRealMP);
                Commentary("本時(shí)段中線="+Text(RealMidLine));
                Commentary("上時(shí)段中線="+Text(PreRealMidLine));
                Commentary("本時(shí)段倉位="+Text(MyRealMP*EveryLots));
                Commentary("上時(shí)段留倉="+Text(PreMyRealMP*EveryLots));
                Commentary("當(dāng)前時(shí)間="+TimeToString(CurrentTime));
                Commentary("清倉標(biāo)志="+Text(qcbz));
               
        }
End
//------------------------------------------------------------------------

//------------------------------------------------------------------------
// 簡稱: LeftRightTrading
// 來源: www.tumamayizhan.com QQ 1145508240

// 類別: 公式應(yīng)用
// 類型: 用戶應(yīng)用
//------------------------------------------------------------------------

 

 

 

有思路,想編寫各種指標(biāo)公式,程序化交易模型,選股公式,預(yù)警公式的朋友

可聯(lián)系技術(shù)人員 QQ: 1145508240  有需要幫忙請(qǐng)點(diǎn)擊這里留言!!!進(jìn)行 有償 編寫!不貴!點(diǎn)擊查看價(jià)格!

 


【字體: 】【打印文章】【查看評(píng)論

相關(guān)文章

    沒有相關(guān)內(nèi)容
  主站蜘蛛池模板: 成人免费观看视频高清视频 | 无翼乌日本漫画| 亚洲欧美成人永久第一网站| 美女裸免费观看网站| 国产真实乱子伦精品视频| 亚洲精品中文字幕无码av| 西西人体www高清大胆视频| 国产精品自产拍在线观看花钱看| 一级特黄色毛片免费看| 日韩高清在线日韩大片观看网址| 亚洲精品视频在线播放 | 性刺激久久久久久久久| 久久精品国产亚洲AV无码偷窥 | 双手扶在浴缸边迎合着h| 久久精品国产四虎| 国产香蕉国产精品偷在线| 一区免费在线观看| 无码少妇一区二区浪潮AV| 五月天婷婷在线视频国产在线| 欧美老熟妇xB水多毛多| 国产极品美女高潮无套在线观看| bban女同系列022在线观看| 捏揉舔水插按摩师| 九九热精品国产| 欧美日韩一区二区三区四区在线观看| 免费乱码中文字幕网站| 老司机在线免费视频| 国产大片免费天天看| 桃花阁成人网在线观看| 在线天堂中文官网| 一本一本久久a久久综合精品蜜桃| 日本中文字幕电影| 亚洲av日韩av无码av| 毛片网在线观看| 人妻精品久久久久中文字幕一冢本 | 中文字幕一精品亚洲无线一区| 日韩午夜高清福利片在线观看| 亚洲人成色7777在线观看不卡| 污网站视频在线观看| 免费v片在线看| 精品国产免费一区二区三区|