Topics
Replies
leo8three
27 Jun 2014, 00:00
RE: RE:
I'm sorry, I've just realized my last answer is utterly wrong.
There is a lot of work for me to do in advance...
Forex19 said:
leo8three said:
@ Forex19: concerning the bad TP calculation, I think the problem is in
private int LotStep = 3000;you can change it to LotStep = 1000 or 10000
Do you think that the error is in the value "3000" or variable declared "private" ?
@ Spotware: Forex19's robot places an order than modifies it, using old API classes "Trade.Create***MarketOrder(...)", and OnPositionOpened(...) where a new TP is set up; what is the best way to update this system to the new API?
I think a solution could be to try the following methods: ExecuteMarketOrderAsync(TradeType.***, Symbol, Volume, "My Label", OnExecuted); and
private void OnExecuted(TradeResult result) { if (result.IsSuccessful) { ModifyPosition(position, position.StopLoss, TakeProfitPrice); } }does it can be a good solution?
Kind regards
Could you better indicate which parts of the code update? And how exactly?
Thank you very much.
@leo8three
leo8three
26 Jun 2014, 18:18
@ Forex19: concerning the bad TP calculation, I think the problem is in
private int LotStep = 3000;
you can change it to LotStep = 1000 or 10000
@ Spotware: Forex19's robot places an order than modifies it, using old API classes "Trade.Create***MarketOrder(...)", and OnPositionOpened(...) where a new TP is set up; what is the best way to update this system to the new API?
I think a solution could be to try the following methods: ExecuteMarketOrderAsync(TradeType.***, Symbol, Volume, "My Label", OnExecuted); and
private void OnExecuted(TradeResult result) { if (result.IsSuccessful) { ModifyPosition(position, position.StopLoss, TakeProfitPrice); } }
does it can be a good solution?
Kind regards
@leo8three
leo8three
14 May 2014, 17:47
RE: Hello,
Hi
do we need the declaration:
using cAlgo.API.Internals;
to make it works?
Thanks a lot
admin said:
The below code must be what you might need:
protected override void OnTick() { if( Account.Equity - Account.Balance > 10 ) { foreach (var position in Account.Positions) { Trade.Close(position); } } }
Let us know if that worked for you!
@leo8three
leo8three
25 Aug 2017, 23:54
Re: stop other robots from a single one
Hello everybody,
I'm the one more guy in search for a solution to this problem.
In addition to the already mentioned third party softwares, external file references etc., I was wondering if we can use the main server as a signal beacon.
Let's hypothesize we have our good MM Robot that wants to protect our equity level by closing all positions and stop other robots when things go wrong . What if it sends a bad volume order (suppose 0$) to deliberately made the main server to produce an error code? At this point we could use the OnError method to stop all your robots on the BadVolume error code. I will try to feature this trick very soon.
And here comes my suggestion to Spotware: why don't try to add a specific error code (HaltRequest would be a nice name) in a way that could use the server as a beacon for a signal generated from the client side?
What do you think about this idea? Is it feasible in your opinion?
Thanks for your attention.
Kind regards
@leo8three