Stop Signal
Created at 13 Jul 2016, 21:59
Stop Signal
13 Jul 2016, 21:59
Hi All,
Can someone help please,
How can i stop the cbot order from an indicator signal when its last trade is a loss; or create an order at the middle of the stoploss and at the same time stop the signal? beacause the bot stil continues to take an order when its signal still true after a stoploss.
Thanks for your help!
cyfer
14 Jul 2016, 10:23
I usually do this through a Bool Swtich
Lets say your signal is a Long Trade and before it's opened the Bot is waiting for the Signal
In this case The Bool Switch (Lets Call it CanOpenLongTrade) will be true
To initialize
Now Your cBot Got the Signal , Let's say on OnTick Method , You test for the Validity of opening a Long Trade
and at the same OnTick or OnBar method you Swich it Off
Now it will not take the long signals again
Still you must turn it back on , maybe after the Trade is closed , According to specific time or what ever you want
The point is you :
-Start with the bool switch True
-Check for being true before a position is opened
-Turn it off immediately after you open the trade
-Turn it back on again to allow the cBot to open another position
@cyfer