If you think this is a bug of CLI and not a user mistake, then you would need to document it with a bit more evidence e.g. some screenshots or videos showing this happening, as well as provide any other information that could help the team reproduce such a behavior.
My apologies, I seem to be unable to create a new topic.
Quick question. Can you explain why there have been no new cBots or indicators on your Algorithms section since 8th September? Normally, both those areas are pretty busy, but just seems to have drawn to a halt abruptly without any company PR/explanation. I personlly think this is bad for platform morale (the lack of comms) and makes you guys seem a little disconnected.
Anyway, apologies if it's just my login for some reason that's only seeing back to 8th September and if so, can you fix it for me -thanks
Hi there,
Now all new algorithms need to be uploaded to our store
You need to create a cTrader ID with the correct email address and ask your broker to link your accounts to the new cTrader ID.
Best regards,
Panagiotis
Thanks for the prompt reply. What I don't understand is that I am getting emails from cTrader.com to my correct email address with my account statement. If the account is not linked, surely I would not receive those emails? Which makes me wonder why I can't see my account when logging into cTrader.
Hi there,
You can see which accounts are linked to your correct cTrader ID in the link below
Since OnStop() is not called for cBots running in the cloud, I was wondering how I can ensure proper cleanup when stopping the cBot. Specifically, I’d like to close any open positions and delete any pending orders that were created by the cBot before it stops.
Is there any recommended approach or workaround to handle this in the cloud environment? For example, is there a way to automatically trigger such cleanups when the cBot is stopped manually in the cloud?
Thanks again for your help!
Best regards,
Anus+
Unfortunately there is no workaround at the moment. If your strategy depends on OnStop() method, then it is better not to execute it on the cloud but on your own VPS.
// Define session times (Eastern Time) private readonly TimeSpan asianSessionStart = new TimeSpan(18, 0, 0); // 6 PM ET private readonly TimeSpan asianSessionEnd = new TimeSpan(4, 0, 0); // 4 AM ET private readonly TimeSpan londonSessionStart = new TimeSpan(3, 0, 0); // 3 AM ET private readonly TimeSpan newYorkSessionEnd = new TimeSpan(16, 0, 0); // 4 PM ET
protected override void OnStart() { Print("Enhanced Range Breakout Bot Started");
// Ensure we are operating on the correct instrument if (SymbolName != TradeSymbol) { Print("This bot is configured to trade " + TradeSymbol + ". Please switch to the correct chart."); Stop(); }
atr = Indicators.AverageTrueRange(14, MovingAverageType.Simple); // ATR for volatility filtering
// Moving Average for trend filtering if (UseMovingAverage) { movingAverage = Indicators.MovingAverage(MarketSeries.Close, MaPeriod, MovingAverageType.Simple); }
protected override void OnBar() { var currentTime = Server.Time.ToLocalTime().TimeOfDay;
// Step 1: Identify Range During Asian Session if (currentTime >= asianSessionStart || currentTime <= asianSessionEnd) { if (!rangeSet) { asianHigh = MarketSeries.High.LastValue; asianLow = MarketSeries.Low.LastValue; rangeSet = true; rangeBroken = false; Print("Setting range: Asian High = " + asianHigh + ", Asian Low = " + asianLow); } else { asianHigh = Math.Max(asianHigh, MarketSeries.High.LastValue); asianLow = Math.Min(asianLow, MarketSeries.Low.LastValue); } }
// Step 2: Look for Breakouts During London and New York Session if (currentTime > asianSessionEnd && currentTime < newYorkSessionEnd) { double atrValue = atr.Result.LastValue; double range = asianHigh - asianLow;
// Check for valid volatility (Range must be greater than ATR * Multiplier) if (range >= atrValue * ATRMultiplier) { Print("Range detected: " + range + " ATR = " + atrValue);
// Additional Moving Average filter to confirm trend direction if (UseMovingAverage) { bool isBullish = MarketSeries.Close.LastValue > movingAverage.Result.LastValue;
// Breakout: Buy if price breaks above the range and trend is bullish if (!rangeBroken && MarketSeries.Close.LastValue > asianHigh && isBullish) { Print("Breakout detected! Going long."); OpenPosition(TradeType.Buy); rangeBroken = true; } // Breakout: Sell if price breaks below the range and trend is bearish else if (!rangeBroken && MarketSeries.Close.LastValue < asianLow && !isBullish) { Print("Breakout detected! Going short."); OpenPosition(TradeType.Sell); rangeBroken = true; } } else // No moving average filter { // Breakout: Buy if price breaks above the range if (!rangeBroken && MarketSeries.Close.LastValue > asianHigh) { Print("Breakout detected! Going long."); OpenPosition(TradeType.Buy); rangeBroken = true; } // Breakout: Sell if price breaks below the range else if (!rangeBroken && MarketSeries.Close.LastValue < asianLow) { Print("Breakout detected! Going short."); OpenPosition(TradeType.Sell); rangeBroken = true; } } } else { Print("No trades: Volatility too low. Range: " + range + ", ATR Multiplier: " + atrValue * ATRMultiplier); } }
// Step 3: Close All Positions at the End of New York Session if (currentTime >= newYorkSessionEnd) { CloseAllPositions(); rangeSet = false; // Reset range for the next day Print("New York session ended. Positions closed, range reset."); } }
private void OpenPosition(TradeType tradeType) { var positionSize = CalculatePositionSize(); var stopLossInPips = StopLossPips; var takeProfitInPips = TakeProfitPips;
var result = ExecuteMarketOrder(tradeType, SymbolName, positionSize, "RangeBreakout", stopLossInPips, takeProfitInPips);
if (UseTrailingStop && result.IsSuccessful) { SetTrailingStop(result.Position); } }
private double CalculatePositionSize() { // Risk calculation based on Stop Loss and Account Balance double accountRisk = Account.Balance * RiskPercentage / 100; double pipValue = Symbol.PipValue; double positionSize = accountRisk / (StopLossPips * pipValue);
AMP Futures offers a TON of trading apps and they are both US and global. Any chance you could reach out to them about offering cTrader? I use them and I'd much rather trade with cTrader.
Also, as a sidenote, most futures trading packages in the US connect to Rithmic, CQG or TT to place the trades. A few, like Sierra Chart can place trades directly on the exchange.
Hi there,
We do not contact brokers, brokers contact us. You can contact them and ask them to offer cTrader to their clients.
AMP Futures offers a TON of trading apps and they are both US and global. Any chance you could reach out to them about offering cTrader? I use them and I'd much rather trade with cTrader.
Also, as a sidenote, most futures trading packages in the US connect to Rithmic, CQG or TT to place the trades. A few, like Sierra Chart can place trades directly on the exchange.
Hi there,
We do not contact brokers, brokers contact us. You can contact them and ask them to offer cTrader to their clients.
PanagiotisCharalampous
30 Sep 2024, 05:49
RE: RE: My fix API access doesnt work
ctid8404604 said:
Hi there,
It seems you are sending an invalid password. Please check your password.
Best regards,
Panagiotis
@PanagiotisCharalampous