
Topics
Replies
Waxy
10 May 2018, 18:56
Hello Panagiotis,
I've done a lot of codes for other traders and I do think a couple features would be nice to have, I think Spotware team has their hands busy and are missing some small details.
- For example, it would be nice to have more flexible parameter types i.e.:
- Datetime, so the user doesn't have to input a date as a string leading to errors, of course, I can check if the date is being parsed correctly, but the issue here is that it's not practical for the end user.
- Enum types:
- Instead of setting parameters like these: "Long = true / Short = false" or type a string "Long/long/Buy/buy" for long and "Sell//sell/Short/short" for short, including just the TradeType as an actual parameter would solve this.
- Some users also ask for custom types, i.e: "Low Risk/Medium Risk/High Risk" or "Trade Limit Only/Trade Market Only" these type of enum parameters are available on other platforms like MT4 and it would be really useful to have them.
- Another important feature would be buttons included on the API, I can already do this with Windows Forms, but it would be nice to have a quick feature so the buttons would be included inside the charts.
- Also, it would be nice to have the objects used drawn on backtesting, sometimes lines and objects are part of the systems and not having them makes it hard to backtest/debug, again this feature is implemented on MT4 already.
- Same day tick optimization.
- Step by Step backtesting.
I think some if not all of these features are very important, especially the objects on backtesting and parameter types, would be nice if you could help me push some of these features to be implemented anytime soon.
Xavier R.
@Waxy
Waxy
20 Mar 2017, 04:30
Thank you Lucian,
I drop this in case someone else needs it,
string[] _Codes = new string[] { "EURUSD", "GBPUSD", "EURJPY", "USDJPY", "AUDUSD", "USDCHF", "GBPJPY", "USDCAD", "EURGBP", "EURCHF", "AUDJPY", "NZDUSD", "CHFJPY", "EURAUD", "CADJPY", "GBPAUD", "EURCAD", "AUDCAD", "GBPCAD", "USDNOK", "AUDCHF", "USDMXN", "GBPNZD", "CADCHF", "USDSEK", "GBPCHF", "EURRUB", "USDRUB", "USDCHN", "EURSEK", "GBPZAR", "USDTRY", "NZDCHF", "EURPLN", "USDZAR", "EURMXN", "EURDKK", "EURHUF", "SGDJPY", "EURNOK", "EURHKD", "GBPNOK", "USDHUF", "NZDCAD", "EURZAR", "EURCZK", "NZDSGD", "USDPLN", "EURNZD", "AUDNZD", "EURTRY", "USDDKK", "NZDJPY", "USDCZK", "USDSGD", "GBPSGD", "GBPSEK", "AUDDKK", "AUDSGD", "AUDZAR", "CADMXN", "CHFNOK", "CHFSGD", "CHFZAR", "DKKNOK", "DKKSEK", "EURCNH", "EURRON", "EURSGD", "GBPDKK", "GBPTRY", "HKDJPY", "NOKJPY", "NOKSEK", "NZDSEK", "USDRON", "ZARJPY", "SEKJPY" };
@Waxy
Waxy
12 Jul 2016, 06:05
look it up with history, you can do:
foreach (var hist in History) { if (hist.ClosingPrice == 1) { //Do Stuff } } // HistoricalTrade _hist = History.FindLast("Label"); Print(_hist.ClosingPrice); // HistoricalTrade[] _histlist = History.FindAll("Label"); Print(_hist.ClosingPrice);
@Waxy
Waxy
24 May 2016, 05:49
Thank you galafrin, can't believe I had no idea of this.
So my purpose was to use a function for a range (day) and skip the weekends, I had to find a more reliable source code, tho not efficient it works, anyway I'll post it here.
DayOfWeek _ref = MarketSeries.OpenTime.LastValue.DayOfWeek; int i = 0; int _auxday = 1; while (_auxday < _DaysToCompute) { if (MarketSeries.OpenTime.Last(i).DayOfWeek == _ref) { i++; } else { _ref = MarketSeries.OpenTime.Last(i).DayOfWeek; UseFunctionForDayBack(_auxday); _auxday++; } }
@Waxy
Waxy
06 Apr 2016, 21:13
Hello fcomanjoncabeza
Even easier, just do:
var _CurrentTF = MarketSeries.TimeFrame;
@Waxy
Waxy
01 Apr 2016, 06:09
Use a random label generator function and run it before placing the first trade, here's mine:
protected string GetLabel(string _TType) { Random rn = new Random(10); int x = rn.Next(100, 10000); _Label = _TType + x.ToString(); var _CLD = History.FindLast(_Label); var _CLO = Positions.Find(_Label); while (_CLD != null || _CLO != null) { x++; _Label = _TType + x.ToString(); _CLD = History.FindLast(_Label); _CLO = Positions.Find(_Label); //Theres a duplicated Label, finding another one } return _Label; }
Then do something like
string Label = GetLabel(Symbol.Code);
@Waxy
Waxy
01 Apr 2016, 06:01
This code has some bugs
First: You can't close a position that's already closed, most of your code happens when a position is closed, so you can't ask it to close it again, you could check it throws an error with: "Entity not found"
TradeResult OperationResult = ClosePosition(position); if (!OperationResult.IsSuccessful) { Print("Operation could not be done, error: {0}",OperationResult.Error); }
Second: You don't reset the counter if the last position is profitable, btw if you want to check the losers in a row do this.
int losercount = 0; //declare it earlier foreach (var hist in History) { if (hist.Label == "Martingale") //within your bot trade history { if (hist.NetProfit < 0) { losercount++; if (losercount == 3) Stop(); } else { losercount = 0; } } }
@Waxy
Waxy
31 May 2018, 01:50
Hello Patrik,
I must repeatedly do this in order to work, hopefully, there will be a fix for backward compatibility soon, right?
Best Regards
@Waxy