If(((bLongExitCon And bTimeCon And longPosition>0) Or longPosition>LongEndLots ))
{
Data0.A_SendOrder(Enum_Sell,Enum_Exit,Data0Lots,Data0.Q_BidPrice-OffsetPoint*MinMove*PriceScale);
Data1.A_SendOrder(Enum_Buy,Enum_Exit,Data1Lots,Data1.Q_AskPrice+OffsetPoint*MinMove*PriceScale);
SetGlobalVar(0,longPosition - EveryLots);
}
If(((bShortExitCon And bTimeCon And shortPosition>0) Or shortPosition>ShortEndLots ))
{
Data0.A_SendOrder(Enum_Buy,Enum_Exit,Data0Lots,Data0.Q_AskPrice+OffsetPoint*MinMove*PriceScale);
Data1.A_SendOrder(Enum_Sell,Enum_Exit,Data1Lots,Data1.Q_BidPrice-OffsetPoint*MinMove*PriceScale);
SetGlobalVar(1,shortPosition - EveryLots);
}
If((bLongEntryCon And bTimeCon And longPosition<LongEndLots))
{
Data0.A_SendOrder(Enum_Buy,Enum_Entry,Data0Lots,Data0.Q_AskPrice+OffsetPoint*MinMove*PriceScale);
Data1.A_SendOrder(Enum_Sell,Enum_Entry,Data1Lots,Data1.Q_BidPrice-OffsetPoint*MinMove*PriceScale);
SetGlobalVar(0,longPosition + EveryLots);
}
If(( bShortEntryCon And bTimeCon And shortPosition<ShortEndLots))
{
Data0.A_SendOrder(Enum_Sell,Enum_Entry,Data0Lots,Data0.Q_BidPrice-OffsetPoint*MinMove*PriceScale);
Data1.A_SendOrder(Enum_Buy,Enum_Entry,Data1Lots,Data1.Q_AskPrice+OffsetPoint*MinMove*PriceScale);
SetGlobalVar(1,shortPosition + EveryLots);
}
}