Topics
Replies
Nego
24 Jul 2013, 11:26
@ algoforce: Thank you, I will post results of the demo account every now and then.
@Cerunnos: Unfortunately the trading volume came to its limit after the first 80 trades, otherwise you would see that there is an exponential growth due to a smart money management. the first 50 trades were executed with a small volume, until the account balance has increased. Feel free to ask any questions.
@Nego
Nego
24 Jul 2013, 11:22
//+---------------------------------------------------------+ //| Limits the Volume | //+---------------------------------------------------------+ int VolumeLimit(int lprmnVolume, int lprmcMaxVolume=800000) { int lnVolume = Math.Min(lprmnVolume,lprmcMaxVolume); return(lnVolume); } //+---------------------------------------------------------+
I suspect you simply dont know the Math.Min() function ...
@Nego
Nego
19 Jul 2013, 13:05
Hi there,
concratulations to this Robot. Having good backtesting results is a first and very important step. Although you should test with 60$ commission per Million. In the list we can see at IC Markets for e.g. that they charge 30$ per Million (3$ per Lot). However you get charged this when opening and again when closing. (Note that some brokers show commission per side and some per round turn)
I assume you have been forward testing this Robot for a while now. I'd be happy to see and discuss the results.
Also, I do have some Robots that I am happy to trade. Contact me at nego[at]nego-forex.com
Cheers
Nego
@Nego
Nego
18 Jul 2013, 19:33
RE:
Hi i will that my robot close all the opened position if the equity is XXX (parameter).
I have find this:
var netProfit = 0.0; foreach (var openedPosition in Account.Positions) { netProfit += openedPosition.NetProfit; } if(Account.Equity > Equity) { foreach (var openedPosition in Account.Positions) { Trade.Close(openedPosition); Stop(); }but so the robot close only one trade, the oldest, them shut down himself properly, but al trade are open.
I searched a lot on the site but did not find anything.Can someone help me?
Thanks and Regards
Hi there, I really dont understand why you have the Stop(); within the foreach part.
Try this:
var netProfit = 0.0; foreach (var openedPosition in Account.Positions) { netProfit += openedPosition.NetProfit; } if(Account.Equity > Equity) { foreach (var openedPosition in Account.Positions) { Trade.Close(openedPosition); } Stop();
Now the Robot stops only after all positions have been closed. I hope this helps.
Nego
@Nego
Nego
26 Jul 2013, 16:16
RE:
Well, there is a way to stop all robots, as long as all robots constantly check for some sort of signal. For example, if you use a global variable as a flag that one robot sets true (such as glStopAllRobots = true). Now all Robots check OnTick or OnBar if this flag a) exists and b) is set to true. If this is so, stop the robot.
If this doesnt work, you can always drop a note in a file that all robots read.
All this only works when you have access to the robots code, of course....
@Nego