Algorithms, Bots, Software Etc

Hi,
Ive been writing software for almost 30 years and have spent many many hours trying to find the holy grail in forex… Took a break for about 7 years, now back working on some stuff…I have some strong opinions about forex… So my bots have these assumptions.

  1. Forex is more like gambling than we want to admit. Therefore, past performance is a weak indicator.
  2. Indicators suck… Use as little as possible.
  3. More trades is better, its like Vegas, its balances the risk.
  4. Martingales are cool… but they WILL blow up your account… Even with small lot sizes… Learned my lessons there… I avoid them…
  5. Shortest time in market is best. If it aint working, get out soon.
  6. Baskets are cool, Statistical analysis… with Huge weight on the most recent activity is the key.
  7. MT4 great for trading… sucks for back testing… Write back testers from Scratch using real variable spread tick data… More threads the better…
  8. One reason that I got back on the forex train recently is that from Jan to today… In 6 months… we have the most chaotic market ever. If the strategy will survive all of these months, it might be a winner.
  9. small consistent profits win out over doubling your account every month. If you could double your account every month, you could be a billionaire in a couple of years… Ever met a person that made billion in forex?
  10. Ive never known anyone with a winning automation to share it. If you share it, it will die. That seems to be the sad truth… Best to keep it close to your chest…

Starting to build a club of sorts of like minded people advanced software guys.

3 Likes

You a coder?

I’d like to add to this:

A. Don’t use indicators (AT ALL). Instead learn Japanese candlestick price patterns because
[ :1st_place_medal: They Rule] ref: Japanese Candlestick Charting Techniques They aren’t successful 99% of the time, but they provide entries way earlier than a lagging indicator [Earlier Entry = More pips]

B. Don’t use Martingales (Under every market condition) Only apply it to strong trending conditions.

C. (5) minute-time-frame [Rules] when using the 1hr, Daily and Weekly to reference momentum and entries.

D. Don’t use Stop-Losses in every market condition (only use a TP). 99% of traders use a “stop-loss”, hence they fail at “stopping their losses”. Furthermore, I’ve gathered information from an insider at a brokerage who’s validated that Brokers do monitor stop-losses, and market makers use them to set traps. (ECN brokers aren’t exempt). (They also get paid when your stop is hit). (No stop-loss, broker becomes confused when monitoring your EA).

E. Risk to reward should always be (1:4 or 1:5) if you use a stop-loss. :1st_place_medal:

F. Scalping is [King :crown:] and long-term trading is boring and produces slow-profits. (You want pay-every-day). not once a week.

G. Don’t share your personal winning EA because once everyone has it, (magically) it does fail. :arrow_lower_right: (Don’t know why this is a true phenom, but it holds true to the principle).

H. When programming an EA, avoid having user-defined functions, function-calls, variables, classes and structures scattered throughout disorganized sections of the code. Organization is King for the EA’s readability and longevity.

  1. Place all Global Variables in one distinct location of the code. [labeled accordingly]
  2. Place all User defined functions in one distinct location of the code. [labeled accordingly]
  3. Place all Trade Operations in a Structure or Class. [labeled accordingly]
  4. Place all Event Handlers in a Class (Meaning duplicate their names using a Class Method). [labeled accordingly]
    EXAMPLE: [original on tick] = OnTick(); [class method duplicate] = Expert.OnTick(); (This approach takes away the heavy lifting from the Event-Handlers and allows you to later hide the entire program’s code using the #include file ().

I forgot an integral part:

I. Limit Orders are better than Buy/Sell Stop orders because if a gap or spike in price occurs, a limit order will be filled at a more desirable position, whereas a Buy/Sell Stop order will be relocated and filled at a less desirable position.

return; :100:

May I ask how you all programmatically handle specifying trading hours?

start_hour=0;
end_hour=23;

is clunky AF, but I also don’t want an individual external variable to toggle for each hour. Wanted to see how others do it.

The advantage to making an external var for each hour is that you can backtest… but Im not a big back tester…

So what I do is…
Create a input var with the hours you want to trade…
input string GoodHoursToTrade=“04,05,06,07,08,09,10,11,14,15,16,17,18,19,20,22,23”;

Notice the Leading zero for numbers 0-9…

Now in your logic… I …

int hour = TimeHour(TimeCurrent());
string TempHour;
if(hour >=0 && hour <=9) // build a TempSubScring to search by
TempHour=“0”+IntegerToString(hour); // make sure there is a leading zero…
else
TempHour=IntegerToString(hour); // already is 2 digit.

if(StringFind(GoodHoursToTrade,TempHour,0) >= 0 ) // if more than = to zero, it found it in my string… Good hour
{
DoTheLogic();
}

1 Like

Makes sense. Create a list and search it. That at least solves the 24hr problem. Thank you for the feedback.

Other advantage to making whatever mechanism external beyond backtesting of course is that these are exposed as choices when running, to exclude undesirable hours. Some strategies have sessions when there are more fakeouts than breakouts, etc…