Stopping bot issue
Created at 08 Aug 2019, 17:24
FU
Stopping bot issue
08 Aug 2019, 17:24
Hello,
There is an issue with my bot:
void OnPositionsOpened(PositionOpenedEventArgs obj)
{
Notifications.SendEmail("furko.zoltan1989@gmail.com", "furko.zoltan1989@gmail.com", "Sell has begun!", "Opened");
Stop();
}
This stop my bot after opening the position. But the only problem that this code stop all of instances which is under that bot. Could you help me how to stop just the opened instances?
Or any other suggestion to stop the bot?
PanagiotisCharalampous
08 Aug 2019, 17:31
Hi furko.zoltan1989,
If you run the same code in all instances, then all instances will stop. The solution would be to filter the positions by instance and stop the cBot only if the opened position has been opened by the specific instance. You can use the position label for this puprose and have a different label for each instance. Then on OnPositionsOpened check if the position has the instance's label and act accordingly.
Best Regards,
Panagiotis
@PanagiotisCharalampous