My chart setup:
data1: stock option
data2: stock
Code:
---------------------------------------------------
[INTRABARORDERGENERATION = TRUE]
IF C OF DATA2 > C[1] OF DATA2 THEN BEGIN
BUY THIS BAR AT CLOSE;
END;
IF C OF DATA2 < C[1] OF DATA2 THEN BEGIN
SELL THIS BAR AT CLOSE;
END;
----------------------------------------------------
The price changing speed of the option is slower than the stock. When the stock price is changed but the option price is not changed, the buy or sell order will not be executed.
However, I want to trade the option based on the movement of the stock. How can I do this?
How to trade option using IOG?
for IOG system you have to use Buy/Sell next bar at Market/stop/limit. Next Bar is the next Tick.
I would use print statement in study to observe what is happening to the computed values in the code to get better understanding of IOG working.
To get end of bar values use
if BarStatus=2 then begin // closing tick of the bar
......
......
end;
There is quite a bit of stuff on IOG on the forum...please do some search and go throught them... it would be a good place to begin with
I would use print statement in study to observe what is happening to the computed values in the code to get better understanding of IOG working.
To get end of bar values use
if BarStatus=2 then begin // closing tick of the bar
......
......
end;
There is quite a bit of stuff on IOG on the forum...please do some search and go throught them... it would be a good place to begin with