| stevehopwoodforex.com https://www.stevehopwoodforex.com/phpBB3/ Print view |
|
| Help with coding using iCustom https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?t=5558 |
Page 1 of 2 |
| Author: | fx800 [ Tue Oct 30, 2018 5:50 am ] |
| Post subject: | Help with coding using iCustom |
Hi I am attempting to code a Tdesk helper ea trading Leon's trading strategy using RSI-X, GANN HILO, MTF HGI using iCustom. The ea will enter a trade when all the indicators line up and exit when H4 RSI-X changes colour on a closed candle. This would give more options to exit when one or two indicators changes colour rather than when all the indicators show opposite signals. This ea could also take advantage of using HGCB 's LIBSSRv5's functionality viz. not buying into a resistance zone or selling into a support zone. I am using the shell from Steve's ea HGCB after removing the code for candle power. The iCustom codes are shown below Code: Select all So far, the ea has failed to send any trades even though the ea compiled without any errors. Perhaps one of our coders could cast an eye on the codes and give your comments where the problem lies. Thanks in advance. peter p.s. I forgot to include the Hgi code as a buy/sell condition in the ea earlier. |
|
| Author: | Wavegarrick [ Tue Oct 30, 2018 6:16 am ] |
| Post subject: | Help with coding using iCustom |
Hi Peter, I like your thought process Anyway, I am not a coder so hopefully someone can help. Cheers Leon |
|
| Author: | fx800 [ Tue Oct 30, 2018 7:15 am ] |
| Post subject: | Help with coding using iCustom |
Thanks for your comments and thanks for sharing your strategy, Leon. I am not a coder either. Just did some copy and paste job using one of Steve's ea as a shell. I have been following your TDesk strategy with grreat interest and encountered a few situations where the ea bought into a resistance zone where the price reverses with a big loss when the trades were closed very late when all the signals were in the opposite direction. BTW, I have found that this can be prevented by adding the SS_SupportResistance_v07 TD indicator. Another possible exit strategy is when either H4 RSI-X and H4 Gann Hilo changes direction or both together. This can be coded if the iCustoms works. peter |
|
| Author: | SteveHopwood [ Tue Oct 30, 2018 8:16 pm ] |
| Post subject: | Help with coding using iCustom |
You are barking at the wrong moon here. You do not need to create your own TDesk drone EA. You already have Desky. I have added advice on including your own iCustom calls in Desky, at the end of Desky's user guide. There is no need to reinvent the auto-trading wheel - that is the whole point of Desky. Do a search for, "//Note to coders adding non TDesk compatible indicators. Here is where you would put your iCustom call." in Desky's code to find the relevant section. Life really is much easier than you are making it. |
|
| Author: | fx800 [ Wed Oct 31, 2018 5:48 am ] |
| Post subject: | Help with coding using iCustom |
Thanks very much for your comments, Steve. Recently I have added Peaky function to Desky to stop it from trading if Peaky is longuntradeable or shortuntradeable. That seems to work. However, I was unable to find "LookForTradeClosure" function in Desky and did not know how to add the trade closure codes to Desky. I have taken a closer look at "Timer function" and thought may be I could add the closure codes next to "CloseTradesOnFlatSigna". The codes I added are as follows Code: Select all Code: Select all The development of TDesky and Desky has been phenomenal and huge thanks to you and Thomas and other contributors. peter |
|
| Author: | SteveHopwood [ Wed Oct 31, 2018 11:46 am ] |
| Post subject: | Help with coding using iCustom |
The code looks as though it should work and you have put it in the correct place. Anything not quite right will show up with use. You have declared two datetimes: datetime OldRsixBarTime=0; datetime OldGannBarTime=0; These will be freshly created at every timer event. We would normally overcome this by declaring these variables as 'static' i.e. static datetime OldRsixBarTime=0; static datetime OldGannBarTime=0; This tells the compiler to retain the value of the variables from one timer event to the next. This does not work here because the code is working through a loop of all the pairs being traded. The indi's would be read only when the first pair was examined - the time variables would then be set to that of the time frame and so the indi's would not be read again. I have already solved this for you, so long as EveryTickMode is 'false i.e. you are taking trading decisions only at the open of a new candle. The code block directly above your "//MOD MTF RSI-X" code is this: Code: Select all Go to the top of the file and do a search for, "CandleOpenTime" to see how this is done. It is a four stage process:
Code: Select all |
|
| Author: | SteveHopwood [ Wed Oct 31, 2018 11:55 am ] |
| Post subject: | Help with coding using iCustom |
I forgot to address this, but it is probably better done separately. Desky does not need a separate function to look for trade closure because it is merely a drone responding to signals from TDesk. Suppose you have CloseOnOppositeSignal set to 'true', you have a buy trade or grid open and TDesk generates a SHORT signal. Do a search for, "//Opposite signal closure" to see the code that sets SellSignal and BuyCloseSignal both to 'true'. You can see then how CloseAllTrades() will close all buy trades without needing to care how many there are to close. You can also see how I deal with closure failures. You would need to add something similar inside your crap custom abortion reading code. |
|
| Author: | fx800 [ Thu Nov 01, 2018 2:49 am ] |
| Post subject: | Help with coding using iCustom |
Thank you very much, Steve for your help. I have added the extra block of code as you have suggested. Will wait and see if things work out. My main concern so far has been whether the construct of the iCustom code for the indicators are correct. I have applied the Alert(val); test to each of them and both generated empty values. Yet, several simple ea's that I added them to just blooming fail to trade ! There lies my frustrations. I am simply learning to construct a few helper ea to aid manual trading. The amended Desky is attached below. peter. |
|
| Author: | SteveHopwood [ Fri Nov 02, 2018 10:36 pm ] |
| Post subject: | Help with coding using iCustom |
It is not always easy to work out how to drag useful information from Crap Custom Abortions. The info that you manage to drag from them after umpteen hours of coding is usually a waste of time. I am not joking when I describe these useless thingies as Crap Custom Abortions. I describe them as such from grim and bitter experience gained over more than a decade of dealing with them. You want to continue to do battle with them? Go ahead. You are an idiot and will one day recognise this. Guess how I know? I will not post here again. Good luck down your road to lunacy. |
|
| Author: | tomele [ Sat Nov 03, 2018 12:47 am ] |
| Post subject: | Help with coding using iCustom |
Hi Peter. You want to learn? We learn best by self-recognizing our faults. Therefore I give you a riddle: A symbol is a symbol is a symbol. Sometimes. Sometimes not. Cheers Thomas |
|
| All times are UTC | Page 1 of 2 |
|
Powered by phpBB® Forum Software © phpBB Limited |
|