Tick vs M1

23 replies

daveng

Customer, bbp_participant, community, 93 replies.

Visit profile

7 years ago #115405

I just want to hear the forum’s take/opinion on using Tick data vs M1 data.

 

From the SQ e-Book by Zdenek Zanka, there is a paragraph which he said that he personally prefers/recommends M1 than Tick. Reason being that the back test results are identical in most cases between Tick and M1, and also the huge benefit of using M1 is the 50 times smaller data size which results in much faster strategy development process.

 

As for me, I’ve been using tick data, but I think using M1 data does have a significant advantage due to the much smaller file size to download and the much faster speed in data mining. It also takes up less space in your HDD especially when you’ve multiple instances of SQ. I’ve 4 instances of SQ running, and the tick data size is enormous. However I managed to overcome that by using junction folder which is a brilliant solution to save tons of space.

 

Anyway just interested to hear your thoughts, opinions, comments on your personal preference over Tick or M1  🙂

 

Safe trading…

 

Regards,

Dave

0

daveng

Customer, bbp_participant, community, 93 replies.

Visit profile

7 years ago #138658

Well, I was doing some tests between Real Tick data and M1, and I think that using M1 data with a higher fixed spread is probably a stricter test when compared to using tick data with variable real spread. Reason being that when you use tick data with variable spread, it is pretty much very dependent on which broker’s data you are using considering the fact that different broker offers different spread range. So if you are using tick data from a broker that offers relatively lower spread, then your back test is likely to differ greatly when you back test on another broker that offers higher spread range.

Whereas on the other hand if you use M1 data with a fixed spread, you can adjust the spread higher to achieve some form of robustness, so if your strategy has a nice back test result, it is likely to see the same results (or better) on another broker. Happy to hear your thoughts.

0

Karish

Customer, bbp_participant, community, sq-ultimate, 443 replies.

Visit profile

7 years ago #138659

Well, I was doing some tests between Real Tick data and M1, and I think that using M1 data with a higher fixed spread is probably a stricter test when compared to using tick data with variable real spread. Reason being that when you use tick data with variable spread, it is pretty much very dependent on which broker’s data you are using considering the fact that different broker offers different spread range. So if you are using tick data from a broker that offers relatively lower spread, then your back test is likely to differ greatly when you back test on another broker that offers higher spread range.

Whereas on the other hand if you use M1 data with a fixed spread, you can adjust the spread higher to achieve some form of robustness, so if your strategy has a nice back test result, it is likely to see the same results (or better) on another broker. Happy to hear your thoughts.

Yes thats current,

M1 data and Tick data is always the best options,

if scalping use a spread of 2~3 PIPS max, if swinging use a spread 3~5 PIPS max,

should do the job,

if you using an ECN broker for scalping my broker (globalprime/axi) will average 0.0~1.0 PIPS spread + Commission, so you almost never see 2~3~5 spread unless its very low volatility in the market or news comes out,

for that reason i also set a maximum spread in my EA,

here is the topic i made not so long ago:   https://strategyquant.com/forum/topic/4383-lets-share-sqs-custom-mql4-functions-here/

check my WorkFlow also here: https://strategyquant.com/forum/topic/4915-workflow-plan/

0

daveng

Customer, bbp_participant, community, 93 replies.

Visit profile

7 years ago #138660

Yes thats current,
M1 data and Tick data is always the best options,
if scalping use a spread of 2~3 PIPS max, if swinging use a spread 3~5 PIPS max,
should do the job,
if you using an ECN broker for scalping my broker (globalprime/axi) will average 0.0~1.0 PIPS spread + Commission, so you almost never see 2~3~5 spread unless its very low volatility in the market or news comes out,
for that reason i also set a maximum spread in my EA,
here is the topic i made not so long ago: https://strategyquant.com/forum/topic/4383-lets-share-sqs-custom-mql4-functions-here/
check my WorkFlow also here: https://strategyquant.com/forum/topic/4915-workflow-plan/

Agree, good to have a spread filter, and i hope SQ4 includes it as an option, and if possible a volatility filter as well.
Btw in your thread u asked for function code on Breakeven and Trailing stop, do u still need it? I can code for u, its quite easy.

0

Karish

Customer, bbp_participant, community, sq-ultimate, 443 replies.

Visit profile

7 years ago #138662

No thanks already got one, but will be cool if you could post your type of TrailingStop/Breakeven On TICK codes in that other post maybe i could use your version also,

thanks.

 

BTW for a for a volatility filter just use ATR as an indicator, do NOT use the ATR as your SL/TP, its bugged in SQ3, use the ATR as an indicator and just set the value to 99999 that way the generator will always pick it up,

hope that helped you out bud.

0

Patrick

Customer, bbp_participant, community, 424 replies.

Visit profile

7 years ago #138663

No thanks already got one, but will be cool if you could post your type of TrailingStop/Breakeven On TICK codes in that other post maybe i could use your version also,

thanks.

 

BTW for a for a volatility filter just use ATR as an indicator, do NOT use the ATR as your SL/TP, its bugged in SQ3, use the ATR as an indicator and just set the value to 99999 that way the generator will always pick it up,

hope that helped you out bud.

 

can you epxlain us why not ot use ATR as SL/TP?

0

Karish

Customer, bbp_participant, community, sq-ultimate, 443 replies.

Visit profile

7 years ago #138664

Actually i dont remember where i saw it, but this bug has been reported a few times,

maybe other members or the member that experienced with this can confirm,

 

i remember that i saw that the ATR not calculating the SL level correctly or something to do with the SL.

0

daveng

Customer, bbp_participant, community, 93 replies.

Visit profile

7 years ago #138666

No thanks already got one, but will be cool if you could post your type of TrailingStop/Breakeven On TICK codes in that other post maybe i could use your version also,

thanks.

 

BTW for a for a volatility filter just use ATR as an indicator, do NOT use the ATR as your SL/TP, its bugged in SQ3, use the ATR as an indicator and just set the value to 99999 that way the generator will always pick it up,

hope that helped you out bud.

I didn’t know ATR is bugged! And I kept enabling ATR for SL/TP while disabling fixed pips.

 

 

First of all, the following code is to declare parameters for both Trailing Stop and Breakeven functions:

 

 

//**Declare input parameters for Trailing Stop
extern bool UseTrailingStop;
extern double WhenToTrail=8;
extern double TrailAmount=2;

//**Declare input parameters for Move To Breakeven
extern bool UseMoveToBreakeven;
extern double WhenToMoveToBE=6;
extern double PipsToLockIn=1;

 

Here are the codes for the Trailing Stop and Breakeven functions:

 

//+——————————————————————+
//| Trailing Stop function                                                   |
//+——————————————————————+
void TrailStop()
{
//Trailing Stop for Buy Order
   for(int b=OrdersTotal()-1;b>=0;b–)
   {
      if(OrderSelect(b,SELECT_BY_POS,MODE_TRADES))
         if(OrderMagicNumber()==MagicNumber)
            if(OrderSymbol()==Symbol())
               if(OrderType()==OP_BUY)
                  if(Bid-OrderOpenPrice()>WhenToTrail*pips)
                     if(OrderStopLoss()<Bid-(TrailAmount*pips))
                        if(OrderModify(OrderTicket(),OrderOpenPrice(),Bid-(TrailAmount*pips),OrderTakeProfit(),0,CLR_NONE))
                           Print(“Trailing Stop of Buy Order “,OrderTicket(),” was successfully adjusted.”);
                        else Print(“Trailing Stop of Buy Order “,OrderTicket(),” was NOT successfully adjusted.”,GetLastError());
   }
//Trailing Stop for Sell Order
   for(int s=OrdersTotal()-1;s>=0;s–)
   {
      if(OrderSelect(s,SELECT_BY_POS,MODE_TRADES))
         if(OrderMagicNumber()==MagicNumber)
            if(OrderSymbol()==Symbol())
               if(OrderType()==OP_SELL)
                  if(OrderOpenPrice()-Ask>WhenToTrail*pips)
                     if(OrderStopLoss()>Ask+(TrailAmount*pips)||OrderStopLoss()==0)
                        if(OrderModify(OrderTicket(),OrderOpenPrice(),Ask+(TrailAmount*pips),OrderTakeProfit(),0,CLR_NONE))
                           Print(“Trailing Stop of Sell Order “,OrderTicket(),” was successfully adjusted.”);
                        else Print(“Trailing Stop of Sell Order “,OrderTicket(),” was NOT successfully adjusted.”,GetLastError());
   }
}
 

 

//+——————————————————————+
//| Move to Breakeven function                                       |
//+——————————————————————+
void MoveToBreakeven()
{
//Move to Breakeven for Buy Order
   for(int b=OrdersTotal()-1;b>=0;b–)
   {
      if(OrderSelect(b,SELECT_BY_POS,MODE_TRADES))
         if(OrderMagicNumber()==MagicNumber)
            if(OrderSymbol()==Symbol())
               if(OrderType()==OP_BUY)
                  if(Bid-OrderOpenPrice()>WhenToMoveToBE*pips)
                     if(OrderOpenPrice()>OrderStopLoss())
                        if(OrderModify(OrderTicket(),OrderOpenPrice(),OrderOpenPrice()+(PipsToLockIn*pips),OrderTakeProfit(),0,CLR_NONE))
                           Print(“Move To Breakeven of Buy Order “,OrderTicket(),” was successfully adjusted.”);
                        else Print(“Move To Breakeven of Buy Order “,OrderTicket(),” was NOT successfully adjusted.”,GetLastError());
   }           

//Move to Breakeven for Sell Order
   for(int s=OrdersTotal()-1;s>=0;s–)
   {
      if(OrderSelect(s,SELECT_BY_POS,MODE_TRADES))
         if(OrderMagicNumber()==MagicNumber)
            if(OrderSymbol()==Symbol())
               if(OrderType()==OP_SELL)
                  if(OrderOpenPrice()-Ask>WhenToMoveToBE*pips)
                     if(OrderOpenPrice()<OrderStopLoss())
                        if(OrderModify(OrderTicket(),OrderOpenPrice(),OrderOpenPrice()-(PipsToLockIn*pips),OrderTakeProfit(),0,CLR_NONE))
                           Print(“Move To Breakeven of Sell Order “,OrderTicket(),” was successfully adjusted.”);
                        else Print(“Move To Breakeven of Sell Order “,OrderTicket(),” was NOT successfully adjusted.”,GetLastError());
   }           
}

 

 

And then you insert the following codes into “void OnTick()” to check for opened orders by TICK. So on every tick it will check for opened orders to call the trailing stop or breakeven function:

   if(CountOpenOrders()>0)
   {
      if(UseTrailingStop)TrailStop();
      if(UseMoveToBreakeven)MoveToBreakeven();
   } 

 

And in the above codes you’ll notice there is another functions being called which is the CountOpenOrders() function which is simply to count the current opened orders:

 

//+——————————————————————+
//| Count Open Orders function                                       |
//+——————————————————————+
int CountOpenOrders()
{
   int TotalCount=0;
   int i=0;

   for(i=OrdersTotal()-1; i>=0; i–)
    {
       if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES) && OrderSymbol()==Symbol())
         if(OrderType()<=OP_SELL) TotalCount++;
   }  
   return(TotalCount);
}
 

0

Karish

Customer, bbp_participant, community, sq-ultimate, 443 replies.

Visit profile

7 years ago #138669

Thanks daveng i will add it to my code template

0

Viewing 8 replies - 16 through 23 (of 23 total)

1 2