| stevehopwoodforex.com https://www.stevehopwoodforex.com/phpBB3/ Print view |
|
| Help with coding Slopey Crossy Bob with pending order https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?t=5465 |
Page 1 of 1 |
| Author: | fx800 [ Tue May 22, 2018 12:18 am ] |
| Post subject: | Help with coding Slopey Crossy Bob with pending order |
Hi I would be very grateful if someone can have a look at the code for SCB with pending order attached below. The codes look ok but the ea is not sending any trades even when all the conditions are fulfilled. Code: Select all Code: Select all peter |
|
| Author: | SteveHopwood [ Wed May 23, 2018 11:17 pm ] |
| Post subject: | Help with coding Slopey Crossy Bob with pending order |
It looks to me as though you have found the reason that SCB failed in the first place - and it is all my fault so do not feel bad about being unable to make your pending orders go. Using your file, look at lines 153-154: double ask=0, bid=0, spread=0;//Replaces Ask. Bid, Digits. factor replaces Point int digits;//Replaces Digits. SCB is a multi-pair trader, so ask replaces Ask and can be used throughout the program. Ditto bid for Bid etc. Then go to line 1776 and the void GetBasics(string symbol) function. This is called whenever ask, bid, spread and digits need populating. By the time void LookForTradingOpportunities(string symbol, int PairIndex) is called, bid, ask, spread and digits should all have the correct values. Now look at line 3757: price = NormalizeDouble(Ask + (PendingOrderBuffer/factor), Digits); This should clearly be: price = NormalizeDouble(ask + (PendingOrderBuffer/factor), digits); Then look at line 3789: price = NormalizeDouble(Bid - (PendingOrderBuffer/factor), Digits); This clearly should be: price = NormalizeDouble(bid - (PendingOrderBuffer/factor), digits); Looking at line 3761 I see another 'Ask' that should be 'ask'. At line 3792 I see another 'Bid' that should be 'bid'. Can you do me a favour please? It is past midnight here and I am going to bed - plus the single malt has been good tonight. Maybe SCB failed because I am an idiot. You might be responsible for his resurgence. |
|
| Author: | fx800 [ Wed May 23, 2018 11:22 pm ] |
| Post subject: | Help with coding Slopey Crossy Bob with pending order |
Very kind of you to help. Will make the necessary changes and see if it works. Thanks again. peter |
|
| Author: | fx800 [ Wed May 23, 2018 11:35 pm ] |
| Post subject: | Help with coding Slopey Crossy Bob with pending order |
The amended version posted below. Waiting to see if it works. Exciting times ahead. |
|
| Author: | fx800 [ Thu May 24, 2018 2:27 am ] |
| Post subject: | Help with coding Slopey Crossy Bob with pending order |
|
|
| Author: | fx800 [ Thu May 24, 2018 5:43 am ] |
| Post subject: | Help with coding Slopey Crossy Bob with pending order |
I am quite puzzled by the ea still not sending any pending order. Chart attached below for AUDUSD H4 and AUDCAD H4. No error messages either. |
|
| Author: | Bruster400 [ Thu May 24, 2018 8:28 am ] |
| Post subject: | Help with coding Slopey Crossy Bob with pending order |
Easiest (if there is such a thing!) was is to use a debug tool - I use MetaEditor's (ME). Open a demo account and launch ME from it. Then, in ME, go to Tools/Options/Debug tab and fill in the details of where and when you want to test - make sure your demo has history for that period. Then open the EA code in ME and from the Debug menu select "Start on Real Data" (F5). This will load the EA to a chart in your demo account. Make sure live trading etc are ticked as you would with loading to a normal chart. The chart will be loaded with debug.tpl as its template so you can change this if needed. Once it's loaded up, go to ME (handy to have two screens...) and you can start to drop in breakpoints to pause the code at points where you want to check things and you can add variables to "watch" which means that you'll see their values / states at each breakpoint. You then just step the EA through its paces using the navigation buttons - play, pause, step into etc. If you're watching the right things at the right time in the code then you should find the issue..... eventually. It's not the best but it's a whole lot better than trying to keep track of what is going on as you read through the code. Hope that helps Bruster |
|
| Author: | fx800 [ Fri May 25, 2018 6:26 am ] |
| Post subject: | Help with coding Slopey Crossy Bob with pending order |
The attached ea is now working. Thank you very much Steve. peter |
|
| Author: | tomele [ Fri May 25, 2018 9:03 pm ] |
| Post subject: | Help with coding Slopey Crossy Bob with pending order |
... and now has a different database identifier as it should. Cheers |
|
| All times are UTC | Page 1 of 1 |
|
Powered by phpBB® Forum Software © phpBB Limited |
|