Hello everyone,
I want to compare each instrument's ATR(20Bars) with its forward 30 bars ATR(20Bars) to see whether ATR(20Bars) is increasing or decreasing and then count those contracts with increasing ATR. I wonder if it is doable in portfolio manager of tradingblox in order to filter trades?
Appreciate!
How to calculate ATR by each contract and count contracts?
-
- Site Admin
- Posts: 1493
- Joined: Fri Sep 12, 2003 10:32 am
- Location: Austin, Texas
Thank you for your reply Jake,
Here is my logic in coding this and I wonder if my logic is right.
variables: InstrumentCount, x type: Integer
InstrumentCount=system.totalinstruments
' Set the instrument to deny trades by default
instrument.DenyAllTrades
ATR_ROC= RateOfChange ( ATR, Forward_Count)
for x = 1 to InstrumentCount step 1
if ATR_ROC>0 then
VDI_Count=VDI_Count+1
Endif
next
Here is my logic in coding this and I wonder if my logic is right.
variables: InstrumentCount, x type: Integer
InstrumentCount=system.totalinstruments
' Set the instrument to deny trades by default
instrument.DenyAllTrades
ATR_ROC= RateOfChange ( ATR, Forward_Count)
for x = 1 to InstrumentCount step 1
if ATR_ROC>0 then
VDI_Count=VDI_Count+1
Endif
next