Thanks
Announcement
Collapse
Looking for a User App or Add-On built by the NinjaTrader community?
Visit NinjaTrader EcoSystem and our free User App Share!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less
Partner 728x90
Collapse
NinjaTrader
Default Quantity Bitcoin Strategy
Collapse
X
-
Default Quantity Bitcoin Strategy
Entry orders require a default quantity which is an integer. That makes sense for non-crypto assets. How do I create a buy order using fiat amount such as $100 instead of 1 which is 1 Bitcoin.
ThanksTags: None
-
Hello Mike,
Thanks for your post.
You can calculate quantity for the order submission to take the price you want to pay and divide it by the price of the asset. This will give you the quantity that you could purchase for that asset. I would then suggest to use Math.Floor to ensure that you are never buying more than intended.
For example:
Code:protected override void OnBarUpdate() { double amt = 100 / Close[0]; int qty = (int)Math.Floor(amt); EnterLong(qty); }
Please let us know if we can be of further assistanceJimNinjaTrader Customer Service
-
Thanks.
I follow you but don't see how that does the job. EnterLong requires and integer type for quantity. Let's say Bitcoin is at 10,000. So, using your method, 100/10000 =.01 which is a double. Then use the floor(.01) = 0. Convert 0 to int and your left with 0 for qty. What am I missing?
By the way, I tried your code but it produced the same result as using 1.Last edited by Mike Winfrey; 07-23-2019, 01:18 PM.
Comment
-
For Crytocurrency trading it would be nice is the default quantity could be set to be satoshi as opposed to 1 coin. I don't know anyone who trades based on the number of coins. its almost always a fraction of a coin even for those coins valued less than $1. Bottom line is default quantity needs to be a double instead on int. That solves the problem.
- Likes 1
Comment
-
Hello Mike,
There currently is not a way to submit order quantities with a fractional value. Support for this is being considered with the ticket ID SFT-1422. I have submitted a vote on your behalf. We cannot offer an ETA or promise of fulfillment, but this would be a requirement for full CryptoCurrency support in the future, which is not available at this time.
Numbers for ticket ID's will be noted in the Release Notes page of the Help Guide when implemented.
Release Notes - https://ninjatrader.com/support/help...ease_notes.htm
When I test this snippet, I always get 0 for qty, and no order is submitted. I may suggest recompiling to ensure changes are applied and maybe also to add prints to confirm what is being sent for the order method's quantity.
Let me know if you have any additional questions.JimNinjaTrader Customer Service
Comment
-
Exactly, 0 is what I get as well.
Big shucks that I have to trade cryptocurrency with by the coin. LOL Seems that wasn't thought through very well. Really, for anyone trading cryptocurrency that's an obvious requirement. Regardless, i look forward to that being included. Will I be notified directly or just need to keep checking and how do i do that?
Thanks
- Likes 1
Comment
-
Hello Mike,
Numbers for ticket ID's will be listed under release notes, but as this would be an integral part of Crypto Currency trading, there will likely be large announcements made when more support is added and partial quantities are supported too.
You could subscribe to the News and Announcements forum and keep an eye out for information there, but again, I could not say anything regarding ETA's or any progress behind this.
If there is anything else we can do to help, please let us know.JimNinjaTrader Customer Service
Comment
-
Thanks for this information. I wanted to transfer funds to https://changehero.io/ exchange platform to buy more crypto. More support for cryptocurrency trading is required.
- Likes 1
Comment
-
Thank you guys for this help. I wanted to transfer funds, too, just like incircles said after I've finished understanding the tips on the https://cryptoinformator.com/ webpage that were essential to me. I needed them to gain confidence in these coins, and now I'm ready to proceed. In fact, rn I don't joke with any information concerning crypto or trading, just trying to get as much knowledge of it as possible. I even went ahead to bookmark the News and Announcements forum and keep an eye out for knowledgeable info on there. I'm going to try to use this help now and see if it works; fine, if not, I might then start another thread. You'll see my feedback tho.Last edited by adamspike; 05-12-2021, 01:38 AM.
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by pmachiraju, 11-01-2023, 04:46 AM
|
8 responses
147 views
0 likes
|
Last Post
by rehmans
Today, 06:44 PM
|
||
Started by mattbsea, Today, 05:44 PM
|
0 responses
5 views
0 likes
|
Last Post
by mattbsea
Today, 05:44 PM
|
||
Started by RideMe, 04-07-2024, 04:54 PM
|
6 responses
33 views
0 likes
|
Last Post
by RideMe
Today, 05:31 PM
|
||
Started by tkaboris, Today, 05:13 PM
|
0 responses
5 views
0 likes
|
Last Post
by tkaboris
Today, 05:13 PM
|
||
Started by GussJ, 03-04-2020, 03:11 PM
|
16 responses
3,282 views
0 likes
|
Last Post
by Leafcutter
Today, 04:14 PM
|
Comment