Nio and Tin Market in MZ3

Want to buy? Want to sell? Advertise here!
User avatar
User

Loke

Rank

Lt Commander

Lt Commander
Posts

160

Joined

Mon Jun 30, 2014 7:39 pm

Nio and Tin Market in MZ3

Postby Loke » Sun Jun 18, 2017 6:24 pm

The market for Niobium and Tin trading in Menzel 3



Price development
Image
Selling price


This is a market where the best price available for both selling and buying adjusts automatically to supply and demand! Meaning you always get the current market price!



Purpose:

    -Track and record Niobium and Tin prices, and make a chart to show how the prices develop over time. The chart will be posted here.
    -Increase availability and trade of Niobium and Tin
    -Make it easy for players to know what the current market prices are at any time.
    -It is NOT in any way ment to influence market price one way or the other


Advantages:
    -Easy for miners to see when the price is good and the time to sell
    -Quickly rebalance your own stocks. No reason to be troubled with imbalanced stocks anymore.
    -Need nio and tin to trade for modules and ships? You can buy the nio/tin here and then proceed to trade. No mining required.


Stockmarket limitations:
    -Changes of amounts available for sale for each price level only updates when someone clicks on sell button for that spesific price, all other price levels will not update until each are pressed. Same goes for buy prices. One tip is to sell/buy just one to get amount updated.
    -Unfortunatly the next price level will only be visible after the owner of the OSB is visting or the 1 time per day script run on server, meaning there will be a delay after a price level is filled, before better prices show up. Can be up to 24 hours.
    -Currently each level in price has 200k difference in amount for nio/tin, limiting how much are available for current market price at any time. This migth get increased in the future.
    -Be careful what you click on! Due to how price/amount have to be listed, the list is always long and its easy to accidently hit the wrong button and buy/sell at wrong price, getting a bad deal.


Autopilot in Menzel 3:
Image



Nio Tin Market after update on 8th july 2017:
Image
Last edited by Loke on Sun Oct 22, 2017 9:28 pm, edited 28 times in total.
Callsign: Fraaggii or Loke
Senator Loke of Primo Spe, 8086, New Horizon, Skadi, Darkfield and Niu Heimar

Statistics for Nio and Tin prices: viewtopic.php?f=9&t=3427
User avatar
User

Loke

Rank

Lt Commander

Lt Commander
Posts

160

Joined

Mon Jun 30, 2014 7:39 pm

Re: Nio and Tin Market in MZ3

Postby Loke » Mon Jun 19, 2017 3:58 pm

Here are the .ahk scripts I use for Stock Markets, its lazy coding but it works. If I could just figure out loop syntax the way I want, code would be a lot cleaner.
I recommend testing scripts in notepad to check if output is as wanted.


Recommended functionality for all scripts:
Sometimes there is a need to abort during the script if something goes wrong, I added this to the end of scripts:
Esc::ExitApp
;Put it at the end, just before return, and you can click esc at any time to stop it immediately.


Edit:
After RAM showed how to do the loops code improved a lot, here are the new script for deleting orders in SM:

Requires that orders are within the same range of numbers (which they will be if they were scripted in at the same time)
If you want to delete sell orders with numbers from 1801 to 1830, edit the script to s=1801 and sstop=30, and all 30 orders will be deleted. Do the same with b and bstop for buy orders.

s=18867 ; lowest sell order number to delete
sstop := s + 50 ;I picked 50 but this is however many times you want this to run.
b=20449
bstop := b + 50

^!d:: ; ctrl + Alt + d runs the script, check that the cursor is in SM console before you run it. You dont want to run it in chat!
loop {
Send delsell %s%{Enter}
Sleep 500
s:=s+1
} Until s > sstop

loop {
Send delbuy %b%{Enter}
Sleep 500
b:=b+1
} Until b > bstop

return




Script for Nio Tin Market

This one got a bit more complex to make it work for any changes I want.

delay := 500 ;time between each send in millisekund, recommend 500 in game. For testing in notepad use less, makes it quick

First we need to input the price range to sell or buy between. For example if we want the lowest price to be 100k and the highest 150k, edit script to pricerange := [100000,150000]
We can also add another (or as many as we like) price range, f.ex. to add orders from 150k to 175k which can have different change in price and/or quantity between each order, just add 175k to pricerange := [100000,150000,175000] The numbers in pricerange must be in ascending order.
The increase in price between each order is set in pdif_range := [5000,10000], this example will create orders with prices at every 5k between 100k and 150k, and 10k between 150k and 175k
The difference in quantity is set in qdif_range := [30000, 10000], now the quantity per order will decrease by 30k for the first range and 10k for the second.

;pricerange must always have 1 more number within [] than pdif_range and qdif_range, 2 price ranges will look like this:
pricerange := [100000,150000,175000]
pdif_range := [5000, 10000]
qdif_range := [30000, 10000]


;Then we need a function to write all the orders, do not edit anything in this:

create_order(delay,text,step,steps,offset,pricerange,pdif_range,qdif_range){
amount := offset
number := step
Loop {
var := ((pricerange[number+1]-pricerange[number])//pdif_range[number]*qdif_range[number])
amount := var + amount
number++
} Until number > steps
price := pricerange[step]
Qdif := qdif_range[step]
Pdif := pdif_range[step]
end := pricerange[step+1]
if (step > 1 ) {
price += Pdif
amount -= Qdif
}
loop {
Send %text% %amount% %price%{Enter}
Sleep %delay%
amount -= Qdif
price += Pdif
} Until (price > end) or (amount < 0)
}


;I use ctrl + Alt + n to start the output after ensuring the cursor is inside SM console:
^!n::

;This part is for calculating how many diffenent ranges are in pricerange
count := 0 ;needs to be set to 0 to ensure the script can be run several times
for key, value in pricerange
count++
steps := count-1



;Now we can start putting in what we want to sell or buy. Use this template for each item to sell and again if also buying, example for selling niobium:
text := "sell niobium" ;input sell or buy and item
offset := 100000 ;selling down to this quantitiy or buying this much at the highest price, if set to 0 it will buy 0 at highest price
step := 1 ; dont edit, resets to step 1 before calling the function to write orders
Loop {
create_order(delay,text,step,steps,offset,pricerange,pdif_range,qdif_range)
step++
} until step > steps


;Reuse for as many items as wanted, example for buying tin:
text := "buy tin"
offset := 50000
step := 1
Loop {
create_order(delay,text,step,steps,offset,pricerange,pdif_range,qdif_range)
step++
} until step > steps


;thats it
return

The output of sell niobium will look like this:
sell niobium 420000 100000
sell niobium 390000 105000
sell niobium 360000 110000
sell niobium 330000 115000
sell niobium 300000 120000
sell niobium 270000 125000
sell niobium 240000 130000
sell niobium 210000 135000
sell niobium 180000 140000
sell niobium 150000 145000
sell niobium 120000 150000
sell niobium 110000 160000
sell niobium 100000 170000


As you can see the quantity for each order is calculated based on the the quantity difference inserted for each price range, and the number of orders that are created based on how much price difference is inserted for each range.
Notice that the first range starts with 100k and ends at 150k, the second starts with an order AFTER 150k at 160k and stops at 170k, since 180k is > 175k. If I had put in 180k as the highest price it would have created the last order with 180k. If there was a third it would also have started after 175k, fourth after end of third and so on.

I higly recommend testing to notepad to see if the output is as expected.


This is how the complete code looks when used for Nio Tin Market:
Code: Select all
#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.


delay := 500 ;time between each send in millisekund, recommend 500 in game. For testing in notepad use less, makes it quick

pricerange := [100000,150000,200000,220000,250000] ; [lowest price, end price first range, end price second range, end n price range,,,, highest price]
pdif_range := [5000,5000,5000,10000] ; price differance between each order, for each range
qdif_range := [100000,200000,100000,100000] ; quantity differance between each order, for each range


;function for creating orders, will write orders for the complete price range put in above.
;Needs to be called once for every type of order.
;For example it needs to be called once for "sell Niobium" and another for "sell Tin". And again for "buy Niobium"

create_order(delay,text,step,steps,offset,pricerange,pdif_range,qdif_range){
amount := offset
number := step
Loop {
var := ((pricerange[number+1]-pricerange[number])//pdif_range[number]*qdif_range[number])
amount := var + amount
number++
} Until number > steps
price := pricerange[step]
Qdif := qdif_range[step]
Pdif := pdif_range[step]
end := pricerange[step+1]
if (step > 1 ) {
price += Pdif
amount -= Qdif
}
loop {
Send %text% %amount% %price%{Enter}
Sleep %delay%
amount -= Qdif
price += Pdif
} Until (price > end) or (amount < 0)
}



^!n::
;ctrl + Alt + n

;count the number of different price ranges
count := 0 ;needs to be set to 0 to ensure the script can be run several times
for key, value in pricerange
   count++
steps := count-1


text := "sell niobium"
offset := 0
step := 1
Loop {
create_order(delay,text,step,steps,offset,pricerange,pdif_range,qdif_range)
step++
} until step > steps


text := "sell tin"
offset := 0
step := 1
Loop {
create_order(delay,text,step,steps,offset,pricerange,pdif_range,qdif_range)
step++
} until step > steps

text := "buy niobium"
offset := 50000
step := 1
Loop {
create_order(delay,text,step,steps,offset,pricerange,pdif_range,qdif_range)
step++
} until step > steps

text := "buy tin"
offset := 50000
step := 1
Loop {
create_order(delay,text,step,steps,offset,pricerange,pdif_range,qdif_range)
step++
} until step > steps

return






Old crappy code:

I removed most of it, but left some of it as an example on how to manually make a script for each SM and keep it stored for easy edit in future.


I keep the big SM orders in scripts, so I can do simple edit in the script, then run deleting script and run updated SM order script. Takes only about 2min to do.

Input orders for Nio Tin Market:
Code: Select all

^!e::
;Ctrl + Alt + e

Send sell niobium 4300000 110000{Enter}
Sleep 500
Send sell niobium 4100000 115000{Enter}
Sleep 500
Send sell niobium 3900000 120000{Enter}
Sleep 500
Send sell niobium 3700000 125000{Enter}
Sleep 500
Send sell niobium 3500000 130000{Enter}
Sleep 500
Send sell niobium 3300000 135000{Enter}
Sleep 500

return
Last edited by Loke on Fri Jul 28, 2017 11:33 am, edited 7 times in total.
Callsign: Fraaggii or Loke
Senator Loke of Primo Spe, 8086, New Horizon, Skadi, Darkfield and Niu Heimar

Statistics for Nio and Tin prices: viewtopic.php?f=9&t=3427
User avatar
User

Moneyman

Rank

Captain

Captain
Posts

679

Joined

Sun Jan 31, 2016 2:53 pm

Location

Massachusetts

Re: Nio and Tin Market in MZ3

Postby Moneyman » Mon Jun 19, 2017 6:48 pm

:mrgreen: What are you going to do when RAM converts LM nio and tin buys to nio and tin sells?
User avatar
User

Loke

Rank

Lt Commander

Lt Commander
Posts

160

Joined

Mon Jun 30, 2014 7:39 pm

Re: Nio and Tin Market in MZ3

Postby Loke » Mon Jun 19, 2017 8:22 pm

Moneyman wrote::mrgreen: What are you going to do when RAM converts LM nio and tin buys to nio and tin sells?


Personally if that happens I would probably find a reason to make a new colony or something, I always find new goals and projects. But to answer a little more on topic, if prices drops, more price steps will be added, all the way down to 10k per ton if needed. Or if prices are going up I will keep adding higher prices as needed.
Callsign: Fraaggii or Loke
Senator Loke of Primo Spe, 8086, New Horizon, Skadi, Darkfield and Niu Heimar

Statistics for Nio and Tin prices: viewtopic.php?f=9&t=3427
no avatar
User

RAM

Rank

Commander

Commander
Posts

471

Joined

Thu Sep 22, 2016 6:36 am

Re: Nio and Tin Market in MZ3

Postby RAM » Mon Jun 19, 2017 8:50 pm

Moneyman wrote::mrgreen: What are you going to do when RAM converts LM nio and tin buys to nio and tin sells?

One, he president could not reverse a buy order to a sell order. Second, Jam has stated before that he plans to to have nio and tin only mined. No other sources of supply for them. Third, I would not want the SS to sell nio and tin. I agree with the concept that a human needs to be in control to acquire these and a few other materials. This means someone has to invest game time to get them. Not always the person using them, but someone has to.
Ban cheese slicers. Make Apollo Sector grate again!
Fan Fiction from an old timer - RAM Memories
User avatar
User

Moneyman

Rank

Captain

Captain
Posts

679

Joined

Sun Jan 31, 2016 2:53 pm

Location

Massachusetts

Re: Nio and Tin Market in MZ3

Postby Moneyman » Tue Jun 20, 2017 11:55 am

:mrgreen: Thanks loke and ram for your response. Moon had a lot more interesting things to say.

I was just teasing you loke ... I'm pleased that you are working with jdw ... jdw is always a friend.
User avatar
User

Loke

Rank

Lt Commander

Lt Commander
Posts

160

Joined

Mon Jun 30, 2014 7:39 pm

Re: Nio and Tin Market in MZ3

Postby Loke » Wed Jun 21, 2017 8:34 pm

Moneyman wrote:I was just teasing you loke


Used the opportunity for a reply explaining how this market is designed to handle major price changes.

Added chart to first post.
Callsign: Fraaggii or Loke
Senator Loke of Primo Spe, 8086, New Horizon, Skadi, Darkfield and Niu Heimar

Statistics for Nio and Tin prices: viewtopic.php?f=9&t=3427
User avatar
User

Loke

Rank

Lt Commander

Lt Commander
Posts

160

Joined

Mon Jun 30, 2014 7:39 pm

Re: Nio and Tin Market in MZ3

Postby Loke » Sat Jul 08, 2017 12:14 pm

Stocks increased, now 200k nio/tin is available for each price level between 110k and 200k. Twice the amount as before. Also added a few price levels between 220k and 250k.

Chart gets updated regularly.
Callsign: Fraaggii or Loke
Senator Loke of Primo Spe, 8086, New Horizon, Skadi, Darkfield and Niu Heimar

Statistics for Nio and Tin prices: viewtopic.php?f=9&t=3427
no avatar
User

stagc2002

Rank

Ensign

Ensign
Posts

27

Joined

Wed Mar 25, 2015 5:47 pm

Re: Nio and Tin Market in MZ3

Postby stagc2002 » Mon Jul 10, 2017 3:13 am

quick Question, what would happen if I filled ALL of your buy orders, this is just an interested query, I have no intention of doing that but I do have sufficient excess stock to fill nearly all the Buy Orders on the SM at the moment, I do mean all players buy orders not just yours
User avatar
User

Loke

Rank

Lt Commander

Lt Commander
Posts

160

Joined

Mon Jun 30, 2014 7:39 pm

Re: Nio and Tin Market in MZ3

Postby Loke » Mon Jul 10, 2017 3:29 pm

stagc2002 wrote:quick Question, what would happen if I filled ALL of your buy orders, this is just an interested query, I have no intention of doing that but I do have sufficient excess stock to fill nearly all the Buy Orders on the SM at the moment, I do mean all players buy orders not just yours


Then the price would drop to 110k as thats currently the lowest price Im buying for. You would have sold almost 2million of nio and tin each, stocks in Nio Tin Market would be a total of 4 350 000 of nio and tin each, you would gain 500+ billion credits, and I would be broke. The lower selling prices would appear as soon as I visit and the stock market updates, then I would assume the lowered prices are tempting to buyers and it starts selling. As stocks lower, buy price increase (again I will have to visit for SM to update before buy prices appear) and you can start selling again. If the "normal" price goes down to 110k I would add more price levels lower than that to cover the new price range.

After you fill all the buy orders and the stockmarket updates, it will look like this (for both nio and tin):
Image

The chart would look something like this:
Image
And you can forever brag about that you caused it 8-)


I understand that this was asked hypothetically, but the buy orders are there to be used, so if you feel like it, go ahead and sell any amount you want. Its the same for players wanting to buy, many are rich enough to buy the market empty, price would increase to 250k, but its there to be used. How the prices develop is up to the miners and buyers, as a miner myself I find it useful to be able to sell when the prices are high, and also the ability to quickly rebalance my stocks is useful. The conclusins so far is that the market works as intended.
My intentions with this market is to increase and simplify trade of nio and tin, if its in any way prohibiting trade I need to do some changes.

Ps. After I increased amount per price level I temporarily lack the credits to buy the full orders for both tin and nio, but will have all the needed credits in a while. Never been good at holding on to credits, basically wasted 400b because I was bored, just before I started the project with this market :roll:
Callsign: Fraaggii or Loke
Senator Loke of Primo Spe, 8086, New Horizon, Skadi, Darkfield and Niu Heimar

Statistics for Nio and Tin prices: viewtopic.php?f=9&t=3427
Next

Who is online

Users browsing this forum: No registered users and 1 guest

Powered by phpBB ® | Style by KomiDesign | Modified by Chris Valleriani