Comments (4)
Hello guy, how are you?
Can you help me?
Method marketWatcher.on("tick", (event:).... not working in production, not reveive information symbols.
Hello, can I see all your code? I need to understand the context and environment. Thank you!
from mida.
`async function startOnSymbols(symbol: any, myAccount: MidaBrokerAccount) {
const marketWatcher = new MidaMarketWatcher({ brokerAccount: myAccount });
try {
await marketWatcher.watch(symbol, { watchTicks: true, });
marketWatcher.on("tick", (event: any) => {
const { tick, } = event.descriptor;
const isExist = allPairs.filter(item => item.symbol === symbol).length > 0
if (isExist) {
const objIndex = allPairs.findIndex((obj => obj.symbol === symbol));
allPairs[objIndex].price = Number(tick.bid)
}
global.SocketServer.emit('CTRADER', allPairs)
});
} catch (e) {
console.log(e)
}
}
`
Localhost work ok, but in production not receive informations symbol.
from mida.
If you put a log does does it works? Put a console.log(tick);
right after const { tick, } = event.descriptor;
?
I think you have an issue with your socket configuration.
from mida.
I found the error, I had a method in my class that exceeded 50 requests per second, and it wasn't going through onTick. Thank you for your help.
from mida.
Related Issues (20)
- Historic Data HOT 5
- objects are null in console.log HOT 6
- Add a function / method that helps calculate take profit and stop loss price points on all symbols. HOT 3
- Account and Balance Update on cTrader
- Profit calculation on currency pairs with JPY as the quote currency is not accurate. HOT 1
- Changing the label field HOT 6
- Mida events subscription fault tolerance HOT 2
- Mida.login error makes object undefined HOT 4
- Create fallback symbols
- placeOrder() timeInForce has no effect HOT 3
- Event based mechanism to determine broker's server open and close. HOT 2
- Create "connect" and "disconnect" events HOT 1
- Mida instances HOT 4
- .toNumber() for MidaDecimal HOT 2
- composePeriods() sets incorrect values HOT 4
- marketWatcher.on("period-close"...) emits wrong timeframe HOT 2
- Error setStopLoss HOT 11
- Mida login on AWS lambda HOT 6
- Adding a custom id to a MidaTradingAccount HOT 4
- Closed Position Detail HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mida.