Newbie question - and I have been looking at the forum but I might just need a little pointing in the right direction.
I simply want to place an order once from within OnBarUpdate and then not have it constantly resubmit on every tick - so I used a Boolean but when I do the order never gets to Sim101.....its not a real strategy just trying to get to grips with how NT works
I have at the top....
#region Variables
privateint lotSize = 1; // Default setting for LotSize
privatebool entrySubmitS = false;
#endregion
...then further down I have....
protectedoverridevoid OnBarUpdate()
{
if (entrySubmitS == false)
{
Print("OnBarUpdate(): S" + Time[0]);
// Only allow entries if we in time zone
if ((ToTime(Time[0]) >= 110000 && ToTime(Time[0]) < 143500))
{
// Entry Signal:
EnterShortStop(LotSize, GetCurrentBid() + -15 * TickSize, "D2");
EnterShortStop(LotSize, GetCurrentBid() + -20 * TickSize, "D3");
entrySubmitS = true;
}
Print("OnBarUpdate(): Out S" + Time[0]);
}}
...so basically once we are in the time zone I want to put in those two orders and then stay at that position in the queue. Currently it resubmits on every tic update - naturally. But the Boolean switch when put in there to true stops even the inital order being sent in.
Apologies if I have missed the obvious - the forum is great - I can see loads of great things I would like to try. Thanks
Comment