HorseFrontRunner Spreadsheet

Samples developed by Cymatic and others. Please share your spreadsheets here.
Forum rules
Users can post their spreadsheets here, to share with others and for discussion purposes.
If you download a spreadsheet from here, please carefully test any strategies yourself before using it with real money. Cymatic accepts no liability for any spreadsheets in this forum.
Now bring on the robots! Happy automated trading... :)

Re: HorseFrontRunner Spreadsheet

Postby Gavin » Sat Aug 01, 2015 12:38 pm

Cym27 wrote:What I have done is to utilise the 2 cells in the Command column below those used for the horses. I've set up a formula which checks for the relevant triggers/conditions and puts "CANCEL ALL" in the upper cell and "GREEN ALL" in the lower when necessary. Therefore I don't clear any of the existing commands manually.

Unfortunately the conditions haven't arisen yet where these commands are issued, so I'm not sure of the result.


Sorry, but that won't work. Trigger commands have to be on lines that actually have horses. Cymatic does not scan and detect trigger commands that are inputted onto rows that are below the ones containing horses.

You could either put your formulae on the last couple of lines that have horses, if you don't mind not being able to bet on those two horses with other formulae, or use VBA.

Kind regards,

Gavin
User avatar
Gavin
Site Admin
 
Posts: 3832
Joined: Wed Jan 23, 2013 9:11 pm
Location: United Kingdom

Excel isnt triggering a bet

Postby 911shady » Sat Aug 01, 2015 5:27 pm

Hi guys , im a little stuck , I cant get my exel spreadshet to trigger a bet , it did once abut dont know why it hasnt befoe or doesnt now .I'm using the sample front runner V4 .the first time it met the requirements to place a bet it came up with a script error .
any ideas guys ?
911shady
 
Posts: 1
Joined: Sat Aug 01, 2015 3:35 pm

Re: HorseFrontRunner Spreadsheet

Postby Cym27 » Sat Aug 01, 2015 6:24 pm

Gavin wrote:
Cym27 wrote:What I have done is to utilise the 2 cells in the Command column below those used for the horses. I've set up a formula which checks for the relevant triggers/conditions and puts "CANCEL ALL" in the upper cell and "GREEN ALL" in the lower when necessary. Therefore I don't clear any of the existing commands manually.

Unfortunately the conditions haven't arisen yet where these commands are issued, so I'm not sure of the result.


Sorry, but that won't work. Trigger commands have to be on lines that actually have horses. Cymatic does not scan and detect trigger commands that are inputted onto rows that are below the ones containing horses.

You could either put your formulae on the last couple of lines that have horses, if you don't mind not being able to bet on those two horses with other formulae, or use VBA.

Kind regards,

Gavin


I was afraid you were going to say that!

So if I have a trigger in Cell CA51 which should trigger the GREEN ALL and CANCEL ALL commands if its value is greater than zero, is this what you are saying we should do in VBA?

Code: Select all
Private Sub Worksheet_Change(ByVal Target As Range)

If Target.Address = "$CA$51" Then

If Range("CA51").Value > 0 Then
Range("BD8").Value = ""
Range("BD9").Value = ""
Range("BA8").Value = "CANCEL ALL"
Range("BA9").Value = "GREEN ALL"
End If


End If

End Sub
Cym27
 
Posts: 149
Joined: Sun Jul 19, 2015 9:47 pm

Re: Excel isnt triggering a bet

Postby Gavin » Sun Aug 02, 2015 1:52 am

911shady wrote:Hi guys , im a little stuck , I cant get my exel spreadshet to trigger a bet , it did once abut dont know why it hasnt befoe or doesnt now .I'm using the sample front runner V4 .the first time it met the requirements to place a bet it came up with a script error .
any ideas guys ?

Hi 911Shandy,

I have moved your message to this section so that someone who is working on the spreadsheet might answer your question. It sounds like a possible error in the VBA within the spreadsheet.

Kind regards,

Gavin
User avatar
Gavin
Site Admin
 
Posts: 3832
Joined: Wed Jan 23, 2013 9:11 pm
Location: United Kingdom

Re: HorseFrontRunner Spreadsheet

Postby sjaak1943 » Sun Aug 02, 2015 6:37 pm

Version 4 has some circular references.
Sjaak

To make a bot is easier then making money with it!
sjaak1943
 
Posts: 63
Joined: Tue Mar 03, 2015 6:31 pm

Re: HorseFrontRunner Spreadsheet

Postby Cym27 » Sun Aug 02, 2015 9:20 pm

Cym27 wrote:
Gavin wrote:
Cym27 wrote:What I have done is to utilise the 2 cells in the Command column below those used for the horses. I've set up a formula which checks for the relevant triggers/conditions and puts "CANCEL ALL" in the upper cell and "GREEN ALL" in the lower when necessary. Therefore I don't clear any of the existing commands manually.

Unfortunately the conditions haven't arisen yet where these commands are issued, so I'm not sure of the result.


Sorry, but that won't work. Trigger commands have to be on lines that actually have horses. Cymatic does not scan and detect trigger commands that are inputted onto rows that are below the ones containing horses.

You could either put your formulae on the last couple of lines that have horses, if you don't mind not being able to bet on those two horses with other formulae, or use VBA.

Kind regards,

Gavin


I was afraid you were going to say that!

So if I have a trigger in Cell CA51 which should trigger the GREEN ALL and CANCEL ALL commands if its value is greater than zero, is this what you are saying we should do in VBA?

Code: Select all
Private Sub Worksheet_Change(ByVal Target As Range)

If Target.Address = "$CA$51" Then

If Range("CA51").Value > 0 Then
Range("BD8").Value = ""
Range("BD9").Value = ""
Range("BA8").Value = "CANCEL ALL"
Range("BA9").Value = "GREEN ALL"
End If


End If

End Sub


Nope, that doesn't work because the formulae in BA8 and BA9 (the Command column) get overwritten. Back to the drawing board!
Cym27
 
Posts: 149
Joined: Sun Jul 19, 2015 9:47 pm

Re: HorseFrontRunner Spreadsheet

Postby Gavin » Sun Aug 02, 2015 11:55 pm

Range("BD8").Value = ""
Range("BD9").Value = ""
Range("BA8").Value = "CANCEL ALL"
Range("BA9").Value = "GREEN ALL"


One small point to mention, it would always be better to clear the status cells as the last command, i.e. after filling in BA8 and BA9, in case there are previous commands left over in the command cells (such as BACK or LAY). You don't want to accidentally trigger those left over commands to repeat again when you clear the status cells (i.e. you would accidentally send another back or lay).

Kind regards,

Gavin
User avatar
Gavin
Site Admin
 
Posts: 3832
Joined: Wed Jan 23, 2013 9:11 pm
Location: United Kingdom

Re: HorseFrontRunner Spreadsheet

Postby Cym27 » Mon Aug 03, 2015 8:34 am

Gavin wrote:Range("BD8").Value = ""
Range("BD9").Value = ""
Range("BA8").Value = "CANCEL ALL"
Range("BA9").Value = "GREEN ALL"


One small point to mention, it would always be better to clear the status cells as the last command, i.e. after filling in BA8 and BA9, in case there are previous commands left over in the command cells (such as BACK or LAY). You don't want to accidentally trigger those left over commands to repeat again when you clear the status cells (i.e. you would accidentally send another back or lay).

Kind regards,

Gavin


Thanks, Gavin, but that code has the same problem as mine - the formulae in BA8 and BA9 get overwritten. But I see canuk has a solution in his version 4 of the spreadsheet:

Code: Select all
Range("BD8:BD33") = ""
   Range("BA8") = "CANCEL ALL"
   Range("BA9") = "GREEN ALL"
   Application.Wait (Now + TimeValue("0:00:03"))
   Range("BD8:BD33") = ""
   
   Range("BA33").Select
   Selection.Copy
   Range("BA8:BA9").Select
   ActiveSheet.Paste
   Application.CutCopyMode = False


In light of your earlier warning not to clear the status cells of any row other than those where the CANCEL ALL and GREEN ALL commands are being placed, I suggest it would be better to do:

Code: Select all
Range("BD8:BD9") = ""
   Range("BA8") = "CANCEL ALL"
   Range("BA9") = "GREEN ALL"
   Application.Wait (Now + TimeValue("0:00:03"))
   Range("BD8:BD33") = ""
 
   Range("BA33").Select
   Selection.Copy
   Range("BA8:BA9").Select
   ActiveSheet.Paste
   Application.CutCopyMode = False


This copies the formula back into BA8 and BA9 after the commands have been issued and hopefully acted on during the Wait instruction.

I wonder if, instead of a Wait instruction, it would be possible to check on the value in BI9 (Report) being "OK"? Would this be sufficient confirmation that the CANCEL ALL and GREEN ALL commands had been completed?
Cym27
 
Posts: 149
Joined: Sun Jul 19, 2015 9:47 pm

Re: HorseFrontRunner Spreadsheet

Postby Gavin » Mon Aug 03, 2015 10:59 am

I haven't checked the outcome but I strongly suspect that the Application.Wait command is a bad idea. It will probably just lock up Excel and prevent Cymatic being able to talk to it, such as sending back the results of the two commands. If Cymatic can't talk to Excel, it will retry but only very briefly, so you will end up with some reports and prices getting aborted, which could be important for your strategy.

You are correct, it is better to check for the completion of a command by looking at the Status and Report columns.
If you test the Target in Worksheet_Change, you can determine whether a change is a either report coming back to Excel with the results of your commands, or merely new prices arriving.
Use Target and the Intersect command to determine which columns were changed.

As your model gets more and more complex, you might find it easier to get rid of the formulae in the command cells and just use VBA to test the conditions and insert the command words at the appropriate times. I only mention this because there seems to be a need to overwrite the formula and later replace them, so why not just put the command cell formula conditions into VBA and avoid the problem. That way you can put whatever you want in the command cells, whenever necessary. Obviously it requires a bit more work in VBA though.

Another option is to leave the formula in the command cell, but in one row make the formula even more complex so that its result in "GREEN ALL" whenever all the other factors indicate that you want to green. Likewise do the same thing for CANCEL ALL in the second runner row.

There are probably many way that you could achieve the desired result, with either formulae or VBA.

Kind regards,

Gavin
User avatar
Gavin
Site Admin
 
Posts: 3832
Joined: Wed Jan 23, 2013 9:11 pm
Location: United Kingdom

Re: HorseFrontRunner Spreadsheet

Postby Cym27 » Mon Aug 03, 2015 12:18 pm

Thanks, Gavin. Obviously we're just testing out different methods at the moment, so when we find one that consistently works in our favour we can work on a "tidied up" version of the spreadsheet.

For the moment I'm just testing the following change:

Code: Select all
Sub CanceAlllGreenAllStop()
'
' CanceAllGreenAllStop Macro
'
' Keyboard Shortcut: Ctrl+a
 Range("BD8:BD9") = ""
   Range("BA8") = "CANCEL ALL"
   Range("BA9") = "GREEN ALL"
  Do Until Range("BI8") = "OK" And Range("BI9") = "OK"
   
    Loop
   Range("BD8:BD33") = ""
   
   Range("BA10").Select
   Selection.Copy
   Range("BA8:BA9").Select
   ActiveSheet.Paste
   Application.CutCopyMode = False
   
End Sub


As well as checking that BI8 and BI9 = "OK" do we also need to check that BD8 = "GREENED" and BD9 = "CANCELLED" in order to detect whether the GREEN ALL and CANCEL ALL commands have been completed successfully by Cymatic?
Cym27
 
Posts: 149
Joined: Sun Jul 19, 2015 9:47 pm

PreviousNext

Return to Excel - Sample Spreadsheets

Who is online

Users browsing this forum: No registered users and 0 guests

cron