人人爽天天爽夜夜爽qc-人人爽天天爽夜夜爽曰-人人天天爱天天做天天摸-人人天天夜夜-色网站在线-色网站在线看

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

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

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

//------------------------------------------------------------------------
// 簡(jiǎn)稱: 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);//是否測(cè)試 True 是 False 實(shí)盤(pán)
       
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í)清倉(cāng),重置中線值
                {
                        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);
                                        }
                                }///來(lái)源: m.kzuj.com.cn 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);
                                        }
                                }
                               
                                // m.kzuj.com.cn **********************************************************
                                //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í)段倉(cāng)位="+Text(MyRealMP*EveryLots));
                Commentary("上時(shí)段留倉(cāng)="+Text(PreMyRealMP*EveryLots));
                Commentary("當(dāng)前時(shí)間="+TimeToString(CurrentTime));
                Commentary("清倉(cāng)標(biāo)志="+Text(qcbz));
               
        }
End
//------------------------------------------------------------------------

//------------------------------------------------------------------------
// 簡(jiǎn)稱: LeftRightTrading
// 來(lái)源: m.kzuj.com.cn QQ 1145508240

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

 

 

 

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

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

 


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

相關(guān)文章

    沒(méi)有相關(guān)內(nèi)容
  主站蜘蛛池模板: 免费高清在线观看a网站 | 夫妻毛片 | 丝袜老师在办公室被狠狠 | 高清欧美一级在线观看 | 韩国欧洲一级毛片免费 | 亚洲综合一区二区三区四区 | 久草福利视频 | 性欧美videos另类hd | 美女被羞羞网站 | 欧美顶级xxxxbbbb | 色播影视| 国产精品99久久免费观看 | 日本18网站 | 成人免费手机在线看网站 | 亚洲无线一二三四区手机 | 久草最新视频 | 国产精品不卡视频 | 亚洲精品在线免费观看视频 | 青草国产精品久久久久久久久 | 亚洲欧美日本在线观看 | 国产成人精品亚洲一区 | 日本国产精品 | 999久久久免费精品国产牛牛 | 成人hd| 亚洲影院在线 | 亚洲精品视频在线观看免费 | 日本综合视频 | 免费操 | 天天色综合社区 | 正在播放一区 | 免费看a级| 国产黄色a三级三级三级 | 午夜视频免费观看黄 | 一级黄色免费观看 | 26uuu在线观看 | 免费的一级片 | 国产午夜视频在永久在线观看 | 99ri视频 | 右手影院亚洲欧美 | 伊人久久大香线蕉免费视频 | 日韩亚洲人成在线 |