Jump to content
UBot Underground

Forex. Calculations from one to another and run. How?


Recommended Posts

I'm not quite sure but I am working on a forex bot that can calculate numbers and do a run base on the calculation results.

Lets say USD has a 1.3665 and the results will come later about an hour later with the results for example 1.3777. This means the market went up an hour. Can ubot calculate these two and have it do something I want the bot to do afterwards?

If so which, area in ubot can I learn this from at the left side?

Link to post
Share on other sites

Try the example below. I used whole numbers for the example but it will work the same with 4 decimal points.

 

So you would do a scrape for "first price", then do another scrape an hour later for "second price" (I just used a set/random number for the example) then use an if command to see if the price went up or down.

ui button("run") {
    set(#first price, $eval($rand(1, 9)), "Global")
    set(#second price, $eval($rand(1, 9)), "Global")
    if($comparison(#first price, "<", #second price)) {
        then {
            alert("Price went up")
        }
        else {
            alert("Price went down")
        }
    }
}
Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...