It was the Bitcointalk forum that inspired us to create Bitcointalksearch.org - Bitcointalk is an excellent site that should be the default page for anybody dealing in cryptocurrency, since it is a virtual gold-mine of data. However, our experience and user feedback led us create our site; Bitcointalk's search is slow, and difficult to get the results you need, because you need to log in first to find anything useful - furthermore, there are rate limiters for their search functionality.
The aim of our project is to create a faster website that yields more results and faster without having to create an account and eliminate the need to log in - your personal data, therefore, will never be in jeopardy since we are not asking for any of your data and you don't need to provide them to use our site with all of its capabilities.
We created this website with the sole purpose of users being able to search quickly and efficiently in the field of cryptocurrency so they will have access to the latest and most accurate information and thereby assisting the crypto-community at large.
/**
* Basic swing trading strategy example. Buys when price is a desired percentage below a configured midpoint, and submits an accompanying sell at a desired percentage above the midpoint. Once a buy has been submitted, no more buys will be submitted until the accompanying sell has filled.
*/
// ----------------------------------------------------------------------------
// Step 1 - define the config inputs
// ----------------------------------------------------------------------------
const market = input({
type: input.market,
label: 'The market (i.e. trade pair on an exchange) that this bot monitors and submits orders to',
required: true
});
const midpoint = input({
type: input.number,
label: 'The midpoint price that buy and sell triggers will be centered around',
required: true
});
const percentBelowToBuy = input({
type: input.number,
label: 'Buy trigger - When the price goes <= the midpoint by this percent, a buy is triggered',
required: true,
default: 3,
min: 0.1,
max: 50
});
const percentAboveToSell = input({
type: input.number,
label: 'Sell price - When a buy has been submitted, an accompanying sell will be submitted at this percent above the midpoint',
required: true,
default: 3,
min: 0.1,
max: 99
});
const orderAmount = input({
type: input.number,
label: 'Amount that will be used for each buy and sell order',
required: true
});
// ----------------------------------------------------------------------------
// Step 2 - define any variables the bot will use
// ----------------------------------------------------------------------------
const buyTriggerPrice = midpoint * (100 - percentBelowToBuy) / 100;
const sellTriggerPrice = midpoint * (100 + percentAboveToSell) / 100;
let hasEnteredPosition = false;// if a buy has been submitted and we've entered a position. if true, we are now waiting for the accompanying sell trigger
let submittedBuyOrders = series(); // store all submitted buy orders in a series
let submittedSellOrders = series(); // store all submitted sell orders in a series
// ----------------------------------------------------------------------------
// Step 3 - define the execution logic
// ----------------------------------------------------------------------------
// finally, define the run execution logic that is run on every iteration
run(async () => {
// get the last price on this market
const last = market.last;
if (hasEnteredPosition === false) {
// if we haven't entered a position yet, check if we should buy
const shouldBuy = last <= buyTriggerPrice;
if (shouldBuy) {
// record that we've entered a position
hasEnteredPosition = true;
// submit the buy order as a market order
const thisBuyOrder = await submitOrder({
type: ORDER_TYPES.MARKET_BUY,
amount: orderAmount
});
// store this order in a series so we have access to all submitted orders
submittedBuyOrders.add(thisBuyOrder);
// immediately submit the accompanying sell at the configured price trigger for our exit
const thisSellOrder = await submitOrder({
type: ORDER_TYPES.LIMIT_SELL,
rate: sellTriggerPrice,
amount: orderAmount
});
// again store this order in a series so we have access to all submitted orders
submittedSellOrders.add(thisSellOrder);
}
} else if (hasEnteredPosition === true) {
// if we've entered a position then we've already submitted the limit sell when we bought
// so need to check if it's filled or not. if it's filled, we are no longer in a position
// note: submittedSellOrders.get() defaults to returning the most recently added order. we can get previous orders with submittedSellOrders.get(index)
const sellOrderForThisPosition = submittedSellOrders.get();
if (sellOrderForThisPosition.status === ORDER_STATUSES.closed) {
// the limit sell order that accompanies our buy has filled! we've successfully exited our position
hasEnteredPosition = false;
}
}
});