Home Algorithms Charts Sources Community Pricing Documentation Register
Anything you'd like to say or ask, or just to say hello.


Do you plan on adding support for Interactive Brokers?

posted read more


Re: synchronous price loading messages - The backtest and session runners preload some historical price data into memory for speed of access should your indicators need it.

We use static code analysis, together with a few assumptions, to determine the amount of back data to load in. This can't be fully predetermined before runtime, so the getBufferSize and getRunUpCount functions provide a means to explicitly tell the system how much to load in.

When your algorithm requests data while it is running, the session will halt while it is fetched. This isn't a huge problem for backtests, though it will slow them down, but should certainly be avoided for live trading.

posted read more
We'll let you know when we update the site here
Discuss your algorithms with the community


@Tommaso said:

I have noticed another problem backtesting MACD EMA robot scalper, just to try if all was working, but after it completed it didn't show the results and in the main backtests list it is just a straight line.

A straight line equity curve means no positions were opened.

Taking a look at the indicator (shared v10) it seems the entry criteria are contradictory, or at least unlikely to combine to generate a signal.

In the first block that would generate SELL signals we have:

maCD[1] > maCD[0] MACD is below its signal line, indicating downward trend.

ema(EMAslow) > ema(EMAquick) Fast moving average is below slow moving average, also indicating downward trend.

rsi(periods) > 70 RSI is high, indicating overbought market after upward trend.

I suspect intention here, especially with the take profit action to close opposing long positions in this block, is for the 3 conditions to give confirmation of a bullish and consequently overbought market.

@karel.goldmann I hope you don't mind me taking the liberty - please put back if incorrect... I've saved a version (shared v11) with the first 2 conditions switched to indicate bullish movement. Also added a few lines to plot the indicator values.

I've given it a run and it's opening positions fairly frequently.

posted read more


Hi, we had a bug where nested indicators were not receiving instrument config, so the EMA indicator used by MACD was not able to produce values.

This is now fixed, though please let us know if you see any more issues.


posted read more
The place to discuss anything related to algorithmic trading strategies


... though stock indices are available!

posted read more


That sounds reasonable. We've added it to the development backlog. Note though that we're not currently offering stocks via the forex brokers we're wired up to (trading hours run continuously Sunday 5pm EST to Friday 5pm EST).

posted read more
If you need help with writing your trading algorithms or technical indicators, ask anything here


A check that no positions are currently open around your openPosition block will do the trick:

if (OPEN_POSITION_COUNT === 0) { ... }

posted read more


How do i make sure i only have one position open all the time?

so i tried a stupid basic script but it keeps crashing, can't even do a backtest

M1.onIntervalClose = function () {
// Runs every 1 minute bar close (default instrument)
if (/rsi(14) > 70 && /ema(20) > ema(50) /&& ema(50) > sma(200) /){

OPEN_POSITIONS.each(function (position) { if (position.DIRECTION === "SHORT") { position.close(); } }); openPosition("LONG", { riskPercentage: risk, trailingStopPips: 15 // stopLoss: MID + (stop * PIP_SIZE) }); signalBuy(); } else if (/*rsi(14) < 30 &&*/ ema(20) < ema(50) /*&& ema(50) < sma(200)*/){ //oversold OPEN_POSITIONS.each(function (position) { if (position.DIRECTION === "LONG") { position.close(); } }); openPosition("SHORT", { riskPercentage: risk, trailingStopPips: 15 // stopLoss: MID + (stop * PIP_SIZE) }); signalSell(); } // Runs on every tick of the instrument your session is running on plot("EMA(20)", ema(20)); plot("EMA(50)", ema(50)); plot("SMA(200)", sma(200));

// plot("MACD", {value: maCD[0], overlay: false}, {name: "MACD Signal", value: maCD[1], overlay: false});
plot("RSI(14)", {value: rsi(periods), overlay: false});


posted read more
Support for any problems using the platform or the rest of the site


Hi @ericnaguras. It looks like this is a genuine bug with our code parser.

The error doesn't relate to your code above. The issue is that you can't use your external names in object keys or as variable declarations.

To work around for now, could you change the name of your "lots" external to e.g. "nLots", or alternative replace the openPosition options on lines 31 and 37 with e.g. {quantity: lots * 100000, stopLossPips: stopLoss}

Similarly on lines 83 and 91the "pinLength" variable declaration will need to be named differently to your external name.

Have stuck this bug as high priority and expect to have a fix released today.

posted read more


Why I get this error?

I am trying to see if a price is the high or low in a number of candles.
I only want to look back like 24 or 36 candles.
This is my code:

function roomToTheLeftLow(i){
var counter = 1;
while (counter < room){ //room is 24
if (prices.low(i+counter) >= prices.low(i))
return counter;

posted read more
What would you like Cloud9Trader to do? Let us know here. We'll also post features in out pipeline, so please comment if you'd like them prioritized.


Hi, is there a way to use economic calendars in algorithms? I can't understand if i can do this with source.

posted read more


I should add that is the ability to make GET requests. To that end allowing jQuery as a library makes ajax calls trivially simple. Also - if you are going to allow async call then a library to support promises or integrating the new features of ES6 would be helpful (but not essential).

posted read more
If you've spotted anything that looks broken, please let us know here


Hi. Thanks for pointing this out. It's now fixed, please retry.

posted read more



I've reset your account so you can now retry your OANDA account. Sorry for the delay!

Please let me know if you have any problems.

posted read more