由买买提看人间百态

topics

全部话题 - 话题: volatility
1 2 3 4 5 6 7 8 9 10 下页 末页 (共10页)
X*****s
发帖数: 2767
1
http://www.bloomberg.com/news/2011-12-15/wall-street-traders-co
Duke Buchan III’s $1 billion hedge fund beat U.S. stocks by 46 percent in
the decade through March, a period that included the steepest equity-market
losses since the 1930s.
Then came the selloff in August when global stocks suffered their worst nine
-day drop since the 2008 financial crisis. For four days, The Dow Jones
Industrial Average (INDU) alternated between gains and losses of more than
400 points, the longest streak ever, a... 阅读全帖
X*****s
发帖数: 2767
2
http://www.bloomberg.com/news/2011-12-15/wall-street-traders-co
Duke Buchan III’s $1 billion hedge fund beat U.S. stocks by 46 percent in
the decade through March, a period that included the steepest equity-market
losses since the 1930s.
Then came the selloff in August when global stocks suffered their worst nine
-day drop since the 2008 financial crisis. For four days, The Dow Jones
Industrial Average (INDU) alternated between gains and losses of more than
400 points, the longest streak ever, a... 阅读全帖
F****n
发帖数: 3271
3
来自主题: Programming版 - 用volatile退出线程对不对?(C++)
cache access 和 memory barrier 从reorder 优化的角度是一个道理
为什么recorder优化可行?是因为compiler发现你程序某些部分并不互相关联
所以把顺序换换也没关系。但在并行计算的情况下compiler很难通过语义分析(对C/C+
+来说)确定关联性,所以需要额外的memory barrier,它的一个作用就是把一定的顺
序强加在使用不同cache但访问同样内存地址区的并行进程。
为什么决大多数情况下用volatile退出线程不对? 简单的说,因为有数据一致性
要求时volatile不工作,没有数据一致性要求时,你根本不需要volatile。大多数情况
下你总不可能什么都不做就直接quit吧?总要对一些数据进行操作和判断然后决定是否
quit。举个不太恰当的例子:
Connection conn; // assumed to be a db connection;
bool volatile quit;
...
while (!quit) {
conn.doSomething(); // error if conn is closed
... 阅读全帖
b***k
发帖数: 2673
4
☆─────────────────────────────────────☆
xiaoxiaoxi (小小溪) 于 (Fri Aug 21 12:40:48 2009, 美东) 提到:
说historical volatility不可靠,因为由此得到的option price跟市场价格不符,所以要用市场价格来反推volatility,称之为implied volatility。
问题是统计上来讲,显然是historical volatility更可靠,所以市场价格不是no-arbitrage的,为什么还要用implied volatility而不是市场价格参考historical volatility?
这样一来,就陷入了一个"恶性循环",,要算option的价格,要先根据trader的价格得到implied volatility,然后利用stochastic volatility model或者其他model得到option的价格。这样又回到了我原来的问题,trader的价格是怎么得到的?似乎他们不能用BS Model,因为因为
del的结果依赖于他们的价格。。。
所以所
r****o
发帖数: 1950
5
关于const和volatile,我们知道他们可以修饰变量,也可以修饰指针,如下所述。
int a;
const int *p = a;
volatile int *p = a;
//结论:这里const或volatile修饰a,
int * const p = a;
int * volatile p = a;
//结论:这里const或volatile修饰指针p
我想问的是如果这里是pointer-to-pointer,例如
const int **p = a;
volatile int **p = a;

int ** const p = a;
int ** volatile p = a;
上面的结论是否还成立?另外,如果const或volatile修饰指针,这里是修饰的第几级
指针呢?还是一级指针和二级指针都被修饰?
p***i
发帖数: 96
6
纯公式证明我现在的确不会了,用傻办法分析一下,还是能赚到钱。
虚拟一个股票,假设股价涨一块和跌一块的概率相同,那么未来某一刻的股价就是以股
票现价为均值的正态分布。
如果期末股价不变,volatility pumping肯定会赚到钱。
如果期末股价下降,volatility pumping肯定比直接持有股票要亏得少,甚至是赚钱的。
如果期末股价上升,volatiility pumping可能比直接持有股票赚的少(但肯定是有赚的
),也可能比直接持有股票赚得多(看期间有多少个volatility)。
比如股价每变动1块钱我们做一次rebalance,
若股价变化是:100块---101块---102块---101块---102块---103块。期末价格总共上
涨了3块钱,中间经过了一次volatility pumping的效果,我们这时设用volatility
pumping策略最终赚的钱是x,
若股价变化是:100块---99块---98块---99块---98块---97块。期末价格总共下降了3
块钱,中间也是经过了一次volatility pumping的效果,我们这时设用vola... 阅读全帖
i**********o
发帖数: 5993
7
【 以下文字转载自 Stock 讨论区 】
发信人: caoy (caoy), 信区: Stock
标 题: 用改进的delta neutral方法来volatility arbitrage
发信站: BBS 未名空间站 (Tue Jun 7 11:53:09 2011, 美东)
我觉得有必要把这个方法单独写一个帖子. 作为前面写的两篇的应用.
[1]根据历史股价估算options implied volatility
[2]超快速估算ATM call的贵贱
当期权的implied volatility和historical (realized) volatility相差很大的时候,
我们可以用经典的delta neutral的方法来trade 这个volatility spread, 不过要加一
点改进. (改进的historical vol的估算, 参见[1]).
之所以称作改进的delta neutral, 是因为此时, 我们需要再比较一下call/S 跟你的止
损百分比 (参见[2]), 如果前者比较大, 则我们可以确认了应该short implied volatility... 阅读全帖
r****o
发帖数: 1950
8
来自主题: Programming版 - 问一个volatile和memcpy一起用的问题
谢谢,你是说在memcpy里面的参数里面加cast?
memcpy((volatile *)&a2, &a1, sizeof(s_t));
还有你看这样行不行?
typedef volatile struct
{
...
}s_t;
s_t a1;
s_t a2;
memcpy(&a2, &a1, sizeof(s_t));
这样a1,a2都是volatile,是不是就可以用memcpy了?
a1本来不必是volatile,但是加上volatile是不是也没有大问题?只是多了一点
overhead而已?

*
////////////
typedef struct
{
...
}s_t;
s_t a1;
volatile s_t a2;
...
//assume a1 is initiliazed with some value, and we want to copy its value to
a2
memcpy(&a2, &a1, sizeof(s_t));
这里能直接这么用memcpy吗?会有什么问题呢?
正确的写法应该怎么写?
h**********c
发帖数: 4120
9
来自主题: Programming版 - 用volatile退出线程对不对?(C++)
当初记得是理解为volatile 是不会保留 thread local value,讲操作系统锁说过是两
boolean,说明设计者对可靠性的理解。
其实以前记得讨论过,用一个循环主要是处理missing signal,这个很讨厌,就是很贵
的solaris可能也不能保证notify.所以多线程,和多进程一样,也不一样,因为进程有
返回值,返回了就结束了,也可以wait, wait抓住信号,就可定结束了。但这两条对多
线程不适用。
这都是在实际中写出来的。但多线程的目的是什么呢,主要的目的比如,一个线程处理
一个socket,这样单个线程可以保证收发不影响别的socket。
这些东西也很依赖硬件实现。好在现在基本也都是X86-64.
总之,这个地方,你要问while loop 是对的,是为了处理missing signal, volatile
不volatile应该理解告诉每个thread 不要保留local copy,而是直接取共享值的地址,
也是告诉读程序的人,这个值是要共享的。
最后要理解的是,你永远无法判定一个线程或进程是否在运行,你只能知道它已经结束
了。所以volatile... 阅读全帖
s**7
发帖数: 4
10
来自主题: Quant版 - GARCH modeling of volatility
When I check Black-scholes option pricing model,
The price of the underlying instrument St follows a geometric Brownian
motion with constant drift μ and volatility σ:
Yes. volatility σ refers to unerlying asset's volatility.
Also check here: http://en.wikipedia.org/wiki/Implied_volatility#Solving_the_inverse_pricing_model_function
the implied volatility of an option contract is the volatility implied by
the market price of the option based on an option pricing model.
////About historical volatil
w******y
发帖数: 8
11
May I ask that what is the 'future and forward volatility surface' for? I
have googled this term, but the explanations are fragmented and not clear at
all. I only know 'volatility surface' is also called 'Dupire-Derman-Kani surface'
, which represents the values of implied volatility in the market.
Does the 'future volatility surface' is the same with 'forward volatility
surface'? Or they are completely different? And what is the modeling of '
future and forward volatility surface' for in the ma
b********e
发帖数: 215
12
来自主题: JobHunting版 - C++ volatile请教
volatile告诉编译器不要做优化,读和写直接到memory,一些情况下我知道要用
volatile:
int flag = 1;
while(flag == 1)
{
}
如果其他线程可能会改变flag,这里需要是volatile,否则编译器会优化为 while(
true)
但是如果在多线程下一个变量已经被用synchronisation primitive保护了:
lock(mutex)
int tt = 5;
unlock(mutex)
我们还需要把它申明为volatile吗?否则的话,一个线程改变了变量的值,还没有写到
memory,但释放了metex,另一个线程获得metex,access变量,但memory中的变量的值
还是旧的没改变的。简短来说,就是已经被critical section或metex保护的变量在多
线程中还有必要申明为volatile吗?
c**y
发帖数: 419
13
我觉得有必要把这个方法单独写一个帖子. 作为前面写的两篇的应用.
[1]根据历史股价估算options implied volatility
[2]超快速估算ATM call的贵贱
当期权的implied volatility和historical (realized) volatility相差很大的时候,
我们可以用经典的delta neutral的方法来trade 这个volatility spread, 不过要加一
点改进. (改进的historical vol的估算, 参见[1]).
之所以称作改进的delta neutral, 是因为此时, 我们需要再比较一下call/S 跟你的止
损百分比 (参见[2]), 如果前者比较大, 则我们可以确认了应该short implied volatility,
同时通过long正股, 来long historical vol作为hedge. 胜算将比传统的continuous
rebalancing的delta neutral方法高出很多.
比如现在正股暴跌下来到100块, ATM的call是6块, 而如果我直接买正股的话, 我发现
短期... 阅读全帖
y***r
发帖数: 16594
14
来自主题: Stock版 - volatility will pick up next month
今天算是给了window dress一点面子吧。
虽然我不认为low volatility就一定是问题,不过太长时间死气沉沉也不是个办法。
Fisher is bemused by hand-wringing over low volatility and quiet markets.
After all, the sharp pullback and volatile conditions that rocked the S&P
500 and the Dow Jones Industrial Average DJIA, back in January, which
marked the worst start to a year ever for stocks, and was viewed as a cause
for alarm.
“When it’s volatile, it’s bad; when it’s quiet, it’s bad. That’s a
sign that there isn’t a lot of euphoria. That’s good,” ... 阅读全帖
Y**G
发帖数: 1089
15
来自主题: Java版 - java的volatile
对于volatile成员,java只是标注一下
比如
public class App {
volatile int a = 1;
...
}
用javap看byte code,
...
volatile int a;
flags: ACC_VOLATILE
我以前猜java会对于volatile产生优化的代码,比如
public class App {
volatile int a = 1;
public static void main(String[] args) {
App app = new App();
int x = app.a;
System.out.printf("%d%n", x);
x = app.a;
System.out.printf("%d%n", x);
}
}
但是实际上,在第二次 "x = app.a"的时候,java产... 阅读全帖
F****n
发帖数: 3271
16
来自主题: Programming版 - 用volatile退出线程对不对?(C++)
This is one of the most common misconceptions in C/C++ which have led to
numerous bugs in practice.
The fact is that in C/C++, volatile only tells the compiler "do not optimize
away" this variable. It says NOTHING about load/store operations.
Taking LZ's original post as an example, using volatile will only guarantee
his code will work in a single thread situation, but not in a multi-thread
situation.
You may wonder how could LZ's example be in a single-thread situation. You
are right - this is ... 阅读全帖
d***a
发帖数: 13752
17
来自主题: Programming版 - 用volatile退出线程对不对?(C++)
你没学过computer organization和assembly programming吧。SSA说的明显是对的,那
是CS本科必修课中的基本内容里的东西。
https://users.info.uvt.ro/~iordan/P_I/Ritchie-Kernighan-The_C_Programming_
Language_2_ed.pdf, page 232
The purpose of volatile is to force an implementation to suppress
optimization that could otherwise occur. For example, for a machine with
memory-mapped input/output, a pointer to a device register might be declared
as a pointer to volatile, in order to prevent the compiler from removing
apparently redundant refere... 阅读全帖
w***g
发帖数: 5958
18
来自主题: Programming版 - 用volatile退出线程对不对?(C++)
楼上帮我看看下面的说法有没有问题。
memory barrier有两种:
1. soft barrier: 阻止编译器乱优化。一般以volatile关键字的形式出现。编译后不
会产生对应的指令。有时候-O3出错,但是-O0对了,肯定是缺了soft barrier。
2. hard barrier: 阻止CPU乱执行。一般是以汇编指令/intrinsics的方式出现。改优
化级别不能解决hard barrier用错的问题。
外加一个独立的atomicity问题。
memory barrier和atomicity是两个不同的问题。比如a = a+ 1这个操作,涉及读/算/
写,即使用了memory barrier,在多线程之下还是会出问题。然而反过来,要保证
atomicity必须得用hard barrier。所以gcc的__sync_fetch_and_xxx系列指令全都有
hard barrier
的效果。std::atomic对于基本类型应该就是编译成__sync_fetch_and_xxx,复杂类型
应该是用锁实现,间接涉及__sync指令。所以不管怎样,也都有hard barri... 阅读全帖
b*****d
发帖数: 7166
19
来自主题: Quant版 - volatility forecasting的问题
谢谢!
现在想法是把所有gap看成一个独立的time series,算gap的volatility。剩下的就是
怎么算intraday的部分。办法1:用每天的第一个价格和最后一个价格算出这天的
return,然后用所有这些天的return算一天的volatility。但缺点是丢掉了很多信息。
办法2:用每天的数据(每5分钟一个价格)算这天的5分钟volatility。然后放大成这
天的volatility。这样做的问题是每天的结果是独立的,不知道最后用哪天的好。
办法3:算每5分钟的return,然后把所有return连起来做garch,先不管天与天之间的
gap。
就当成所有数据都是以5分钟为间隔,这样算出过去几年的daily 5分钟volatility。
这几个办法有没有问题?
j******n
发帖数: 91
20
两个call. 一个constant volatility 40%, 一个stochastic volatility with mean
40%. 问两个哪个值钱。
option price is in most cases a convex function of volatility. 所以是由
convex property, constant volatility 的那个option 更值钱。对吗?
k*******t
发帖数: 202
21
来自主题: JobHunting版 - 请教一段volatile和多线程的代码
class SyncBuf {
public:
void Thread1();
void Thread2();
private:
typedef vector BufT;
volatile BufT buffer_;
Mutex mtx_; // controls access to buffer_
};
Inside a thread function, you simply use a LockingPtr to get
controlled access to the buffer_ member variable:
void SyncBuf::Thread1() {
LockingPtr lpBuf(buffer_, mtx_);
BufT::iterator i = lpBuf->begin();
for (; i != lpBuf->end(); ++i) {
... use *i ...
}
}
The code is very easy to wr... 阅读全帖
h****e
发帖数: 928
22
来自主题: JobHunting版 - C++ volatile请教
我觉得不能优化就包括不存在寄存器里:
"If you use the volatile modifier on a variable, the compiler
won't cache that variable in registers — each access will hit
the actual memory location of that variable. "
http://www.drdobbs.com/cpp/184403766
回到LZ最初问的问题,“是不是被Mutex之类的保护的变量是不是就不需要
声明volatile了”,我觉得应该是不需要了吧。同样一篇文章说道:
Inside a critical section defined by a mutex, only one thread has
access. Consequently, inside a critical section, the executing code
has single-threaded semantics. The controlled variable is not volat... 阅读全帖
K**e
发帖数: 56
23
Some quotes from CBOE website: http://www.cboe.com/products/indexopts/vixoptions_spec.aspx
Exercise Style: European - CBOE Volatility Index options generally may be
exercised only on the Expiration Date.
Settlement of Option Exercise: Exercise will result in delivery of cash on
the business day following expiration. The exercise-settlement amount is
equal to the difference between the exercise-settlement value and the
exercise price of the option, multiplied by $100.
If more people think the vo... 阅读全帖
Y**G
发帖数: 1089
24
来自主题: Java版 - java的volatile
这里似乎是正解
http://docs.oracle.com/javase/specs/jls/se7/html/jls-17.html#jl
... a single write to a non-volatile long or double value is treated as two
separate writes: one to each 32-bit half. This can result in a situation
where a thread sees the first 32 bits of a 64-bit value from one write, and
the second 32 bits from another write.
>>> Writes and reads of volatile long and double values are always atomic. <
<<
所以,对于volatile成员的读写一定是原子操作。
非volatile成员,除了long和double,也是原子操作
c*********t
发帖数: 2921
25
来自主题: Programming版 - About volatile in C
Hi,
Ask for help on volatile.
Can someone explain the keyword volatile in C?
What does volatile mean?
When should we use it?
Is it related to optimization or memory operation?
What is the purpose of volatile?
Is it relevant to real time implementation, or hardware-dependent?
Thanks a lot for any advice or reference.
d***a
发帖数: 13752
26
来自主题: Programming版 - 问一个volatile和memcpy一起用的问题
C语言中volatile的意思,是指除当前程序之外,此变量有可能被系统其它部分(例如
中断或信号handler或I/O硬件)改变。
如果这个结构真的是volatile,那么有可能在memcpy运行到一半时,内存的内容改变了
(比如说发生了中断,修改了结构内容)。拷出去的结构内容,一部分是旧的,一部分
是新的,这样最后的内容就错了。加casting可以防止编译器报错,但运行时还是会出
问题。
如果volatile是你自己加的,其实这个结构并不volatile,那就不用担心了。

to
h*****n
发帖数: 209
27
如果volatile
typedef struct
{
volatile int a;
int b;
int c;
}AAA;
ABC abc;
那么compiler只对abc.a是按volatile处理,对abc.b和abc.c仍然按非volatile处理,
对吗?
F****n
发帖数: 3271
28
来自主题: Programming版 - 用volatile退出线程对不对?(C++)
你就不能谦虚一点?这是他的原话
"volatile 就是告诉 CPU 不要优化这个变量 Load/Store 的操作。
每个 memory load/store 都不能省,是有很明确的结果的。
load/store 的优化一般有:
同一个地方load 多次,中间没有写,后面的load和前面一样。
有多个store,前面的 store 可以去掉,最后一个 store 赢。
volatile 保证没有一个 load/store 被省略了。
其他派生出来的就是如何根据这个原理用而以"
你跟我讲讲“不要优化这个变量 Load/Store 的操作。每个 memory load/store 都不
能省”
和C/C++的定义符合的?
恰恰相反,完全错误!
C/C++ volatile周围的load/stores可以随意被reorder优化!因为C/C++不像Java,它
的语言定义不包含内存模型,所谓的load/store这些东西,对C/C++语言本身来说是没
有任何意义的。而volatile是语言定义的一部分,自然也和load/store这些无关。
Memory model在C/C++里是通过at... 阅读全帖
d***a
发帖数: 13752
29
来自主题: Programming版 - 用volatile退出线程对不对?(C++)
老兄,你半懂不懂啊。你不是科班出身的,对吧。
volatile的基本含义就是如SSA所说,那是CS本科课程基础内容。你后来贴的wiki说法
,和SSA说的并不矛盾之处。这是为什么我说,you don't really know what you're
talking about。
楼主该不该用volatile, 和volatile是什么含义,从逻辑上说是两个不同的问题。
就楼主的代码而言,volatile就够了。他的代码的问题不在这里。
l*0
发帖数: 19
30
来自主题: Quant版 - 问个关于volatility的问题
脑子短路了...
the implied volatility of 1 year option is 20%, and the implied volatility
of 2 year option on the same underlying is trading at 10%.
estimate the implied volatility of a one year option forward starting in 1
year
what happens if the one year volatility jumped to 25%.
多谢
b***k
发帖数: 2673
31
来自主题: Quant版 - [合集] 弱问implied volatility
☆─────────────────────────────────────☆
xiaoxiaoxi (小小溪) 于 (Thu Aug 20 19:45:44 2009, 美东) 提到:
说BS模型中volatility不应该是常数,但是historical volatility又不准确,所以用
implied volatility,由市场上option的价格反推出来,
问题是市场上option的价格是怎么得到的?不是根据BS model吗?那算这个价格的
volatility又是怎么得到的?
THANKS
☆─────────────────────────────────────☆
Taikonaut (遨游太空) 于 (Thu Aug 20 19:59:39 2009, 美东) 提到:
到底是先有鸡,还是先有蛋呢?
hoho
既然叫*implied* vol...当然是先有price...在算implied vol啦

☆─────────────────────────────────────☆
Andreas (绿坝坍塌~庶民的胜利!) 于 (Th
d*******n
发帖数: 524
32
Not sure what you meant by "to control the portfolio risk by minimize the
implied volatility".
But in general, to estimate/understand/manage risk it's better to use
historical volatility, which is real-world vol, rather than implied
volatility, which is vol in risk-neutral prob space.
There is no such thing as one vol is more accurate than the other among hist
and implied vols. Implied vol is the collective opinion/guess of the option
traders on the volatility of the underlier. Whereas historica
p********0
发帖数: 186
33
I heard the contrary to "Historical volatility is better than implied". A
prominent prof mentioned in his class said he tried GARCH/ARCH/ARMA
everything, but turn out to use the implied volatility which is more
accurate than the historical one.
Assume Implied volatioity is 100 percent accurate, than by minimize the
implied volatility for a portfolio means the future volatility is minized.
In case error is big(predication power is weak) then minimize doesnot mean
anything useful.
j********t
发帖数: 97
34
来自主题: Quant版 - 请教一个面试题 volatility
有两个不同underlying(比如,IBM和MS)的call,maturity都是2年,S_0, K都一样。
IBM call在第一年volatility是20%, 第二年的volatility是10%.
MS call在第一年volatility是10%, 第二年的volatility是20%
请问哪个call的price更大?谢谢!
a**********0
发帖数: 422
35
来自主题: Quant版 - 提问:volatility and risk的关系
我觉得这个问题很复杂 但是 John Cochrane 在他的书里详细讲了volatility和risk的
关系
见而言是 risk不是asset的volatility 而是它和你的utility的covariance
volatility是描述随机变量运动程度的 但是它选择的参照系是绝对的 covariance 也
是描述随机变量运动程度的 但是它的参照系是你的utility/consumption 基于这个
思想 任何volatility可以分解成两部分 一部分叫做systematic risk 另一部分叫做
idiosyncratic risk 前者形容了asset和大盘的关系 后者是只有individual asset
才有的 后者可通过portfolio进行diversity 理论上可以让这部分变成零 所以经典的
金融理论强调idiosyncratic risk earns no premium
举个例子 你在船上 船相当于大盘 你对船有一个相对运动 船自己有个绝对运动 还有
一个人 他相对于船也有一个相对运动 于是你两人组成的系统可以用如下方式hed... 阅读全帖
q*****l
发帖数: 124
36
一般来说我们是用market option price calibrate出stochastice volatility model
的parameters(比如Heston),带入closed-from pricing formula算出SV model的
option price,最后再invert standard BS price formula求出基于此SV model的BS
implied volatility。
请问此时这个SV model的BS implied volatility的物理意义是什么?可以解释为time/
ensemble average of the local volatility么?
d**n
发帖数: 559
37
下面是Swaptions Implied Volatility的市场数据,我的问题是为什么随着Option
Term的增加,Volatility减少;同时为什么随着Swap Maturity的增加,Volatility减
少。有什么直观或着理论的解释吗?
Swaption Volatilities
Swap Maturity
Option Term 24 60 120
3 Month 72.47 60.155 47.13
6 Month 69.38 55.58 44.56
1 Year 62.76 50.46 42.06
2 Year 55.255 45.89 39.93
3 Year 50.785 43.28 38.69
4 Year 47.665 41.96 37.9
5 Year 44.41 ... 阅读全帖
w*******y
发帖数: 60932
38
Ok, I couldnt run a direct price comparison on these, but I can't find any
Volatile shoes that had an MSRP even close to $10. Ebay they want $25+. On a
site called IvyCouture they wanted $32 for the Plaid Bitsy. Thought they
looked pretty comfy.
Volatile Cabana $7.50 free ship
Red:
http://www.6pm.com/product/7922652/color/585
Kelly Green:
http://www.6pm.com/product/7922652/color/9040
Fushia:
http://www.6pm.com/product/7922652/color/18055
Product Information:
oCool, cute flats show off your sport... 阅读全帖
b********y
发帖数: 5829
39
http://vixandmore.blogspot.com/2010/01/spx-historical-volatility-at-two-year.html
While it is widely understood that the VIX has a tendency to fall during the
holidays (due largely to fewer trading days), a point that slipped past
many pundits is that historical volatility (HV) has been excessively low
during the past few weeks. In fact, last Wednesday the 20 day historical
volatility in the SPX slipped below 10.00 for the first time since October
2007, about one week after the SPX topped at 157
s*******e
发帖数: 432
40
the implied volatility basically is people's expectation for future
volatility. While what you calculate is a historical volatility
c*******y
发帖数: 1630
41
来自主题: Stock版 - Nus volatility halted
Beginning with TWS Version 939, possible values for the HALTED tick type are:
0 = Not halted
1 = General halt (trading halt is imposed for purely regulatory reasons)
with/without volatility halt.
2 = Volatility only halt (trading halt is imposed by the exchange to protect
against extreme volatility).
类似涨跌停吧,是为了保护投资者,幅度过大时候暂停交易。
这个在股市还好,在期货市场,有些品种一连四五个涨停板,逃都没法逃,
100万进去,最后倒贴broker 500万。
c*********e
发帖数: 16335
42
volatile貌似很少人用,一般就是用volatile boolean来设一个true,false.
synchronized更常用。
volatile让这个值不要存到cpu的register里面,而是存到内存里,这样就保证了永远
是最新的值。
貌似现在都是用web application + framework,里面已经有了multi-threading这些东
西了,没必要自己还用这些。一般过去的桌面的application,才需要搞这些高深的东西。
X****r
发帖数: 3557
43
如果有mutex保护,如楼主原帖所说的情况,不需要加volatile,原因
thrust已经讲得很清楚了(opaque function)。
如果没有mutex(或者其他同步机制)保护,需要加volatile,也不能保证对,
原因thrust也已经讲得很清楚了(不保证atomic,也不是memory barrier),
所以这种情况基本上不存在(加了volatile也基本没用)。
e****d
发帖数: 895
44
来自主题: Programming版 - How to use volatile in c++?
Volatile variables disable caching and the order between volatile
variables is guaranteered. Some compilers do also give acquire/
release semantics to volatile variables although it's not standard.
It's obvious not portable and not recommended. I never use it
in this way, just curious anyone does.
c***a
发帖数: 84
45
来自主题: Programming版 - How to use volatile in c++?
Volatile usually has nothing to do with memory cache.
The point is, one almost certainly doesn't NEED to use volatile, at least
not directly in her code. We should stick to operations (atomics, locks, etc
.) whose semantics are easier to understand and reason with.
Same thing with lock free data structures. They may look fancy, but they are
very difficult to get right, usually non-portable, and often perform worse
than locks.
This is not to say volatile and lock free data structures should never... 阅读全帖
i**p
发帖数: 902
46
【 以下文字转载自 Java 讨论区 】
发信人: isup (No), 信区: Java
标 题: Volatile variables do not provide any atomicity
发信站: BBS 未名空间站 (Sun Mar 8 14:38:43 2015, 美东)
This is from book "Core Java"
Volatile variables (private volatile boolean done;) do not provide any
atomicity. For example, the method
public void flipDone() { done = !done; } // not atomic
is not guaranteed to flip the value of the field.
What does "atomicity mean in this context? atomic for "=", for "!" or for
reading "done"?
F****n
发帖数: 3271
47
来自主题: Programming版 - 用volatile退出线程对不对?(C++)
Don't use volatile. Your code is NOT guaranteed to be correct on all
platforms. Unlike in Java, volatile keyword in C++ does NOT enforce memory
barrier, and as a result, the code in your "while(!quit)" loop may be
reordered at the will of the compiler and/or the runtime system.
A rule of thumb in C/C++ is NEVER use volatile.
F****n
发帖数: 3271
48
来自主题: Programming版 - 用volatile退出线程对不对?(C++)
这个就是悖论,他那个condition只要被调用就会有代码
只有从来不会被调用才会完全没问题的
还有一种情况,并行计算中其实有些时候各个进程/线程之间的状态并不需要一致,
如果是这种情况下确实没问题,但是也不需要volatile,什么都不需要。
既然用了volatile就是对一致性有要求,不能说"我这个程序其实不需要一致性所以没
问题”。那你弄volatile是啥目的?
最后,C/C++和Java一个很大的不同就是C/C++很多情况下是全局优化,很多时候你根本
不能假设你的变量最后会怎么样,因为别人可能会调用你的code,然后别人调用代码周
围那些指令,和你的指令会被合在一起优化。
d***a
发帖数: 13752
49
来自主题: Programming版 - 用volatile退出线程对不对?(C++)
再加一个函数,看编译优化输出的代码,更清楚一些:
int volatile_no_sync (volatile int *i) {
*i = 1;
*i = 2;
}
汇编代码:
_no_volatile_no_sync
movl $2, (%rdi)
ret
_volatile_no_sync
movl $1, (%rdi)
movl $2, (%rdi)
ret
_no_volatile_sync
movl $1, (%rdi)
mfence
movl $2, (%rdi)
ret
我前面说过,如果从组织结构和代码生成的角度来看volatile和atomic,其实是很简单
的。volatile的作用就是要编译器不要去掉“多余”的内存访问;在load/store处理器
架构上是load/store指令,在x86架构上是有内存访问的mov指令。
r********n
发帖数: 7441
50
【 以下文字转载自 Quant 讨论区 】
发信人: realoption (Options), 信区: Quant
标 题: 请问两个波动性时间序列预测(Volatility Forecasting)的问题
发信站: BBS 未名空间站 (Mon Feb 18 12:10:49 2008)
1. If I have two volatility forecasting models, how do we know which one is
(uniformally) better than the other?
2. If I want to incorporate short memory in a volatility forecasting model (
e.g. GARCH), how to do this? Same problem for long memory?
delta-t = 1 week
Thanks!
1 2 3 4 5 6 7 8 9 10 下页 末页 (共10页)