Is my usage of [bar] / [Position.EntryBar] correct?
Author: mrsic
Creation Date: 1/26/2018 5:17 PM
profile picture

mrsic

#1
Hi,
I am not a programmer but i give my best.

only for understanding. Can someone tell me if the interpretation of CoverAtLimit is correct?

1.
CODE:
Please log in to see this code.

CoverAtLimit next day (open) based on Close and with the calculation next day. Is that correct?

2.
CODE:
Please log in to see this code.

CoverAtLimit next day (open) based on Close and the Calculation from Yersterday (because -1). Is that correct?

Thanks and greetings
Damir
profile picture

Eugene

#2
Hi there,

1.
QUOTE:
CoverAtLimit next day (open) based on Close and with the calculation next day.

With the calculation based on today's ATR.
2.
QUOTE:
based on Close and the Calculation from Yersterday (because -1). Is that correct?

Based on yesterday's Close and ATR (both).

EDIT 01/28/2017:
Based on the bar preceding the entry bar (for both).
profile picture

mrsic

#3
Hi Eugene,

thanks.

greetings
Damir
profile picture

superticker

#4
If course, there's no space between Close and the indexer [...]
CODE:
Please log in to see this code.

Could someone please tell me why p.EntryBar-1 is being used for yesterday instead of bar-1? Isn't p.EntryBar-1 pointing to the day before the short contract was purchased (which could be several days before present), not necessarily yesterday?
profile picture

Eugene

#5
Mark, that's a good observation. I stand corrected: I overlooked "EntryBar-1" as "bar-1". My reply above edited. Thanks.

Damir, note that p.EntryBar-1 indeed points at the day before the entry which is not "yesterday" and could have happened many bars (days) before.
profile picture

mrsic

#6
Hi Eugene, Superticker,

good job. Thank you.

greetings
Damir