Comments (2)
What do you think if we change gctscript modules implementation as the following
instead of
func ExchangeOrderSubmit(args ...objects.Object) (objects.Object, error) {
if len(args) != 9 {
return nil, objects.ErrWrongNumArguments
}
exchangeName, ok := objects.ToString(args[0])
if !ok {
return nil, fmt.Errorf(ErrParameterConvertFailed, exchangeName)
}
.......
we could use something like
func errorResponse(format string, a ...interface{}) (objects.Object, error) {
return &objects.Error{
Value: &objects.String{
Value: fmt.Sprintf(format, a...),
},
}, nil
}
func ExchangeOrderSubmit(args ...objects.Object) (objects.Object, error) {
if len(args) != 9 {
return errorResponse(objects.ErrWrongNumArguments)
}
exchangeName, ok := objects.ToString(args[0])
if !ok {
return errorResponse(ErrParameterConvertFailed, exchangeName)
}
......
and then in gct scripts, we will be able to use is_error as the following
res := exch.ordersubmit(
if is_error(res) {
// do error handling
}
from gocryptotrader.
@mshogin Please feel free to test out the new updates and let me know of any further suggestions. Thank you for opening this issue, hopefully, your issues are addressed.
from gocryptotrader.
Related Issues (20)
- Excuse me, are there some examples that can teach me how to use gocryptotrader to write a strategy in golang? HOT 1
- The startTime and endTime must be millisecond on Binance query deposit list. HOT 1
- could not find a copy of typescript to link HOT 1
- Binance websocket example
- Bug in Syncmanger does not allow for tickersync only. HOT 1
- any plan to support mexc? HOT 2
- Plase Help Me ... HOT 1
- Dispatcher tries to return used channels that are `<-chan interface{}` as `chan interface` and fails
- Buy/Sell/Ask/Bid actions do not have an expected outcome
- Bitstamp: depreciated balances *_usd _ fee
- Bitfinex: WS cancel stuck waiting for confirmation HOT 1
- Bitfinex: Switch WS type assertions
- pls add support commex.com HOT 3
- Feature request: Backtesting with trades instead of candlesticks and a simulated orderbook
- FTX Move Contract future Stats Greeks HOT 1
- CLI, GUI or Webgui? HOT 1
- Websocket stuck HOT 2
- binance USDTMarginedFutures SubmitOrder Bug HOT 3
- When will the official version be released? HOT 1
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 gocryptotrader.