Topics
Replies
mgalona74
02 Nov 2015, 03:50
RE:
*Spotware said:
Dear Trader,
Please contact your Broker regarding any execution questions.
The order is not cancelled and should not have had this error message. It looks like a bug in the platform this is also a live account very dangerous. Please look into it.
@mgalona74
mgalona74
26 Oct 2015, 14:36
( Updated at: 21 Dec 2023, 09:20 )
RE:
Spotware said:
Dear Trader,
Could you please check how much memory does this custom indicator use over some time?
(You can see the memory each application uses in the task manager)
If without the bollinger band stop it plays around 300-350mb. If I add the indicator it goes from 400-460mb. Hmm I didn't know until now CTrader uses so much memory.
@mgalona74
mgalona74
25 Oct 2015, 10:44
Install it on CTrader then move the windows around resize it etc you will notice it is much slower when resizing.
@mgalona74
mgalona74
25 Oct 2015, 10:42
RE:
Spotware said:
Dear Trader,
Could you please provide us with more information regarding your issue? In addition, could you please tell us you PC specifications?
It slows down the platform. I'm not a coder I just converted it using MT4 converter. It's fast on MT4 but very slow on CTrader. I have a descent PC Windows 10 Quad core processor AMD Athlon II X4 645 3.10GHZ, 4GB Ram. The problem is not my PC I know that for sure.
@mgalona74
mgalona74
14 Oct 2015, 17:02
RE:
Spotware said:
Dear Trader,
Thank you for your suggestion. We will consider it. Additionally, you can vote for it on: http://vote.spotware.com/forums/229166-ideas-and-suggestions-for-ctrader-and-calgo/suggestions/5540904-trade-manager
Wow thanks. Vote done. If this happens for me CTrader becomes perfect.
@mgalona74
mgalona74
06 Oct 2015, 07:06
RE: RMM (risk and money management cBot)
kricka said:
The "Lots to trade 1.0" cBot gives the trader information on lot sizing according to the risk management parameters setup.
You can read more about the cBot right here: Lots to trade 1.0 cBot
It is a free to download and can be run on live and demo accounts without restrictions.
Thanks for this. But it's still not good enough. We want a horizontal line prior to finalizing the order to set the stop loss not a pre-defined stop loss. Then the position adjusts as the price go up and down. I'm a scalper and having to measure the stop loss each time before a trade will not cut it for us scalpers. For example I like placing my stop loss at a previous swing and I would place a horizontal line above/below that swing.
@mgalona74
mgalona74
24 Sep 2015, 08:29
RE:
atrader said:
using System; using cAlgo.API; using cAlgo.API.Internals; namespace cAlgo.Robots { [Robot] public class OnePercentRiskBot : Robot { private Rates _rate = Rates.Direct; [Parameter(DefaultValue = "Volume on Risk")] public string MyLabel { get; set; } [Parameter("0:Buy 1:Sell", DefaultValue = 0)] public int TType { get; set; } [Parameter("Stop Loss", DefaultValue = 10, MinValue = 0, MaxValue = 500)] public int StopLoss { get; set; } [Parameter("Take Profit", DefaultValue = 10, MinValue = 0, MaxValue = 500)] public int TakeProfit { get; set; } // Modify DefaultValue, MinValue, MaxValue [Parameter("Risk Percentage", DefaultValue = 1, MinValue = 0.01, MaxValue = 5)] public double RiskPercent { get; set; } protected TradeType Trade_Type { get { return TType == 0 ? TradeType.Buy : TradeType.Sell; } } protected override void OnStart() { Positions.Opened += PositionsOnOpened; // Initialize _rate variable SetRate(); int volume = GetVolume(); Print("Volume = {0}", volume); ExecuteMarketOrder(Trade_Type, Symbol, volume, MyLabel); } private void PositionsOnOpened(PositionOpenedEventArgs args) { double risk = 0; foreach (Position position in Positions) { Symbol symbol = MarketData.GetSymbol(position.SymbolCode); if (position.StopLoss != null) { double stopLoss = Math.Abs(position.EntryPrice - (double) position.StopLoss)/symbol.PipSize; risk += stopLoss*symbol.PipValue*position.Volume - position.Commissions*2; } } Print(risk); } private int GetVolume() { double risk = RiskPercent/100.0; double volume; switch (_rate) { case Rates.Direct: volume = Account.Equity*risk/(StopLoss*Symbol.PipValue); break; case Rates.Indirect: double stopLossPrice = Trade_Type == TradeType.Buy ? Symbol.Ask + StopLoss*Symbol.PipSize : Symbol.Bid - StopLoss*Symbol.PipSize; volume = Account.Equity*risk*stopLossPrice/(StopLoss*Symbol.PipValue); break; default: // pending volume = 0; break; } return (int) Symbol.NormalizeVolume(volume); } private void SetRate() { switch (Symbol.Code) { case "EURUSD": case "GBPUSD": case "AUDUSD": case "NZDUSD": _rate = Rates.Direct; break; case "USDJPY": case "USDCHF": case "USDCAD": _rate = Rates.Indirect; break; default: _rate = Rates.Cross; break; } } #region Nested type: Rates private enum Rates { Direct, Indirect, Cross }; #endregion } }Maybe this is a start...
Really awesome. What I did is added the bot twice one is to buy and the other is to sell so I just click the right bot to buy or sell. Thank you very much. I really wish the horizontal line option for placing stops would be visible first prior to actually sending the order so that I don't have to use the cross hair to calculate the stop based on pips. Anyway, still awesome bot.Thanks again.
@mgalona74
mgalona74
24 Sep 2015, 08:19
RE:
atrader said:
using System; using cAlgo.API; using cAlgo.API.Internals; namespace cAlgo.Robots { [Robot] public class OnePercentRiskBot : Robot { private Rates _rate = Rates.Direct; [Parameter(DefaultValue = "Volume on Risk")] public string MyLabel { get; set; } [Parameter("0:Buy 1:Sell", DefaultValue = 0)] public int TType { get; set; } [Parameter("Stop Loss", DefaultValue = 10, MinValue = 0, MaxValue = 500)] public int StopLoss { get; set; } [Parameter("Take Profit", DefaultValue = 10, MinValue = 0, MaxValue = 500)] public int TakeProfit { get; set; } // Modify DefaultValue, MinValue, MaxValue [Parameter("Risk Percentage", DefaultValue = 1, MinValue = 0.01, MaxValue = 5)] public double RiskPercent { get; set; } protected TradeType Trade_Type { get { return TType == 0 ? TradeType.Buy : TradeType.Sell; } } protected override void OnStart() { Positions.Opened += PositionsOnOpened; // Initialize _rate variable SetRate(); int volume = GetVolume(); Print("Volume = {0}", volume); ExecuteMarketOrder(Trade_Type, Symbol, volume, MyLabel); } private void PositionsOnOpened(PositionOpenedEventArgs args) { double risk = 0; foreach (Position position in Positions) { Symbol symbol = MarketData.GetSymbol(position.SymbolCode); if (position.StopLoss != null) { double stopLoss = Math.Abs(position.EntryPrice - (double) position.StopLoss)/symbol.PipSize; risk += stopLoss*symbol.PipValue*position.Volume - position.Commissions*2; } } Print(risk); } private int GetVolume() { double risk = RiskPercent/100.0; double volume; switch (_rate) { case Rates.Direct: volume = Account.Equity*risk/(StopLoss*Symbol.PipValue); break; case Rates.Indirect: double stopLossPrice = Trade_Type == TradeType.Buy ? Symbol.Ask + StopLoss*Symbol.PipSize : Symbol.Bid - StopLoss*Symbol.PipSize; volume = Account.Equity*risk*stopLossPrice/(StopLoss*Symbol.PipValue); break; default: // pending volume = 0; break; } return (int) Symbol.NormalizeVolume(volume); } private void SetRate() { switch (Symbol.Code) { case "EURUSD": case "GBPUSD": case "AUDUSD": case "NZDUSD": _rate = Rates.Direct; break; case "USDJPY": case "USDCHF": case "USDCAD": _rate = Rates.Indirect; break; default: _rate = Rates.Cross; break; } } #region Nested type: Rates private enum Rates { Direct, Indirect, Cross }; #endregion } }Maybe this is a start...
Can you please add a movable horizontal line for placing SL and pending order availability for buy and sell stops?
@mgalona74
mgalona74
24 Sep 2015, 08:16
RE: RE:
Chistabo said:
ForexGump said:
atrader: your cbot is pretty good. Do you have something similar that places pending orders instead of market orders? Would place a pending stop order at the next round 5 pip level. Would actually need two cbots: one for pending buy stop and another one for pending sell stop
No need for two cBots, all you need is add another external parameter, i.e. [Parameter("0:Instant 1:Pending", DefaultValue = 0)] public int OrderType { get; set; }, and then add some logic into the code.
Until cTrader / cAlgo implements a method to Find/Get properties of the ChartObjects, the cBot as per original post (with horizontal line movements) is not easy to do; I guess one needs to have own methods to Find/Get ChartObjects properties.
Best regards,
Simon
S love nia
Wow this bot is good this is something I need. Only needs now is a visible horizontal line for placing stop loss before it gets executed. And a pending order for but stop sell stop too. Please can someone add this to the bot? I really don't know how to code....
@mgalona74
mgalona74
23 Sep 2015, 05:20
Only reason I still use MT4 is because Ctrader does not have this feature and on my MT4 I purchased a trade manager that can do this. So I use a bridge to ctrader I first create the order in MT4 then the calculated lot size is sent to ctrader for live execution. But if Ctrader can add this I'll be completely no longer need to use Mt4. Please add this feature. Thank you very much!
@mgalona74
mgalona74
12 Sep 2015, 20:43
And you guys almost got it. With your create new order window just add a risk percent auto calculation there and a moveable horizontal line that adds stop loss. Then lot size is automatically adjusted as the horizontal line is moved.
@mgalona74
mgalona74
12 Sep 2015, 20:36
Here is what that trade manager look like. Please make something like this.
@mgalona74
mgalona74
12 Sep 2015, 17:49
Make this and I will no longer use MT4 right now I still use a bridge due to the Trade Manager In MT4 lot size is calculated on MT4 submit the order in demo and it gets into my live Ctrader account with the correct calculated lot size. This is actually that trade manager I use (www.forexpitstop.com). Look at it and get an idea there. Also, add a moveable horizontal line for placing stop loss.
@mgalona74
mgalona74
06 Nov 2015, 20:21
RE:
Spotware said:
Oh come on Spotware look into this problem there is an obvious bug when sometimes closing a position. It happened to me too but a different error message the error message I got is "Unable to close position order cancelled". That is a lame reply. Makes me think you dont want to fix it or even look into it. Also, I thought brokers cannot manipulate executions using ctrader or maybe they can is that what you are saying?
@mgalona74