I can't arrive to let a value go up and down. If anyone can help me? Like this: 'Alpa' have to circulate between 100 and 1000, the system chose the fall and the rise, lika the tradingmarket. 'Beta' have to circulate between 10 and 70 for example, this numbers may change. etc... I hope someone can help me with the code to let numbers fall and rise... thanks a lot
$alpa=$alpa+(rand(0,1)?-1:1)*rand(100, 1000); Explanation: rand(0,1) returns 0 or 1 (rand(0,1)?-1:1) if it 0 is returned set the sign to minus (-) , if 1 is return set the sign to plus (+) rand(100, 1000) returns a value between 100 and 1000
Are you looking for a random number between those 2 points, or is there some logic that will determine the number?
look it's not on monday 700 and on wednesday only 100 left. It's have to different on a maximum of 20% a day...
something like this maybe: $alpa=$alpa+(rand(0,1)?-1:1)*rand(0, $alpa*0.20); you should explain your problem again...
I can't arrive to let alpa rise or fall. alpa have to rise or fall with maximum 20%. For example; monday it's 100, teusday 110, wednesday 105, thursday 120, friday 122, saturday 103, ........