Have some Problem on how to command program to use only once from either PositonOpenedEventArgs and PendingOrderFilledEventArgs
Have some Problem on how to command program to use only once from either PositonOpenedEventArgs and PendingOrderFilledEventArgs
25 Nov 2020, 04:52
Hello There
I have some problem with how to command the cbot program to use just one way either from PositionOpenedEventArgs and PendingOrderFilledEventArgs when it about a limit or stop order get filled.
when limit or stop order gets filled it will invoke these two methods ( PositionOpenedEventArgs and PendingOrderFilledEventArgs )
but I only want to use just one of them (PendingOrderFilledEventArgs) because it already has args.pendingOrder and args.Positon so I could transfers the data from pendingOrder to positon but when we run code I see that my information from pendingOrder doesn't move to postion and I think that because of I have PositionOpenedEventArgs too.
so is it possible to select just PendingOrderFilledEventArgs to work while PositionOpenedEventArgs doesn't?
Thank you.
Replies
imrealfighter
28 Nov 2020, 03:23
RE:
PanagiotisCharalampous said:
Hi imrealfighter,
It would be easier for us to understand what you need if you shared some code with us. For example, why do you replicate the code on both event handlers if you need it to be executed once?
Best Regards,
Panagiotis
PanagiotisCharalampous like you've said I replicate the code so just delete PositionOpenedEventArgs so it works !
Thank you.
@imrealfighter
PanagiotisCharalampous
25 Nov 2020, 07:42
Hi imrealfighter,
It would be easier for us to understand what you need if you shared some code with us. For example, why do you replicate the code on both event handlers if you need it to be executed once?
Best Regards,
Panagiotis
Join us on Telegram
@PanagiotisCharalampous