I do not understand exactly what Alex Bogdan meant. Instead I would like to summarize what the tension indicator is (hopefully I have interpreted your Java code correctly). Tension is used in the LongDefender and ShortDefender strategies.
1. The stored 'balance' is the following ratio: (average bid size MINUS average ask size) / (average bid size PLUS average ask size), expressed in %. The averages extend over the number of book levels considered or available (normally 5). This percentage can also be negative. 2. The 'tension' is: (exponential mean average of above 'balance') MINUS (the exponential mean average of the mid point prices * scale factor). The EMA needs a 'period' (in our case: number of seconds) as input. The 'scale factor' is necesssary as we are comparing apples with oranges (meaning a percentage value with an absolute value). The mid point price is the mid point of the current bid and ask prices nearest to the current market price. 3. Market orders are generated when the tension surpasses a certain threshold (for inputs 'entry' or 'exit'). LongDefender: Go long when tension > entry, exit when tension < -exit. ShortDefender: Go short when tension < -entry, exit when tension > exit. Please correct me if I'm wrong. This seems to be a simple concept. Now how does this compare to the concepts of Alex Bogdan? -- You received this message because you are subscribed to the Google Groups "JBookTrader" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/jbooktrader?hl=en.
