How I Can make Sleep My cBot for 5 minutes
How I Can make Sleep My cBot for 5 minutes
27 Jun 2018, 19:50
Hi,
I need my CBot to SLEEP for 5 minutes after the Trailed StopLoss is hitten !!!
How can I do it ?
Any help would be really appreciated..
thanks !
Replies
mparama
28 Jun 2018, 17:26
Dear Panagiotis,
thank you very much...it works !!!
Before it goes SLEEP I wrote the code to insert a text on the chart but it doesnt appear when it goes SLEEP.
//================================================
private void FreezeTime()
{
ChartObjects.RemoveAllObjects();
ChartObjects.DrawText("DelayS", "\n\n\n\n\n\n\n\n\n\nFreeze" + " Delay: " + timeFrameSell, StaticPosition.TopCenter, Colors.Red);
if (freeze == 1)
{
//------ 1000 = 1 secondo -----------------60.000 1 minuto----------------
System.Threading.Thread.Sleep(delayMinB * 60000);
ChartObjects.RemoveObject("DelayS");
freeze = 0;
CountS = 0;
OnStart();
}
}
//================================================
Any idea on how to solve it...?
Thank again !
@mparama
PanagiotisCharalampous
28 Jun 2018, 09:41
Hi mparama,
You can use Thread.Sleep() method.
Best Regards,
Panagiotis
@PanagiotisCharalampous