I have figured out how to create buttons, and can get them to work to enter and exit positions OnBarUpdate, but the result of this is that I click the button and then the strategy waits until the end of the bar to actually go long or short. How do I have the order placed right when I click the button? Can Iput the code in the OnButtonClick section like this? It doesn't seem to be working.
private void OnButtonClick(object sender, RoutedEventArgs rea)
{
if (shortButtonClicked)
{
EnterShort(Contracts, @"bearcrashOrder");
}
}
If i move this to the OnBarUpdate section it works, it just waits to EnterShort until the end of the bar if the button is in the clicked state. I want it to enter short as soon as I click the shortButton.
Thanks!
Comment