Row’s Quantum Soaker


In the dimly lit basement of an old Victorian house, Dr. Rowan “Row” Hawthorne tinkered with wires, circuits, and vials of iridescent liquid. His unruly hair stood on end, a testament to his relentless pursuit of scientific breakthroughs. Row was no ordinary scientist; he was a maverick, a dreamer, and a little bit mad.

His obsession? Teleportation. The ability to traverse space instantaneously fascinated him. He’d read every paper, dissected every failed experiment, and even tried meditating in a sensory deprivation tank to unlock the secrets of the universe. But progress remained elusive.

One stormy night, as rain drummed against the windowpanes, Row had a revelation. He stared at the super soaker lying on his cluttered workbench. Its neon green plastic seemed out of place among the high-tech equipment. Yet, it held promise—a vessel for his audacious experiment.

Row connected the soaker to his quantum teleporter, a contraption that looked like a cross between a particle accelerator and a steampunk time machine. He filled the soaker’s reservoir with the iridescent liquid—a concoction of exotic particles and moonlight. The moment of truth had arrived.

He aimed the soaker at a potted fern in the corner of the room. The fern quivered, its fronds trembling with anticipation. Row squeezed the trigger, and a beam of shimmering energy shot out, enveloping the plant. The fern vanished, leaving behind a faint echo of chlorophyll.

Row’s heart raced. He stepped onto the teleporter’s platform, gripping the soaker like a futuristic weapon. The room blurred, and he felt weightless. In an instant, he materialized in the heart of the United Nations General Assembly—an audacious move, even for a scientist.

Diplomats gasped as Row stood before them, dripping wet and clutching the super soaker. The UN Secretary-General, a stern-faced woman named Elena Vargas, raised an eyebrow. “Who are you, and why are you interrupting—”

Row cut her off. “Ladies and gentlemen, I bring you the solution to global conflict.” He waved the soaker dramatically. “This humble water gun is now a weapon of peace.”

The assembly erupted in laughter. Row ignored them. “This device teleports emotions,” he declared. “Love, empathy, forgiveness—they’re all encoded in these water molecules. Imagine if we could share these feelings across borders, erase hatred, and build bridges.”

Elena Vargas leaned forward. “You’re insane.”

“Am I?” Row adjusted his lab coat. “Watch this.” He sprayed a mist of teleportation-infused water into the air. The room shimmered, and suddenly, delegates from warring nations embraced. Tears flowed, and old grievances dissolved. The super soaker had become a conduit for understanding.

Word spread. Row’s Quantum Soaker became a symbol of hope. He traveled to conflict zones, dousing soldiers and rebels alike. The Middle East, Kashmir, the Korean Peninsula—all witnessed miraculous transformations. The soaker’s payload wasn’t water; it was humanity’s shared longing for peace.

As the Nobel Committee awarded Row the Peace Prize, he stood on the podium, soaking wet, and addressed the world. “We’ve spent centuries fighting over land, resources, and ideologies,” he said. “But what if we fought for compassion, kindness, and understanding instead?”

And so, the super soaker became a relic of a new era. Rows of them lined the halls of diplomacy, ready to douse flames of hatred. The world learned that sometimes, the most powerful inventions emerge from the unlikeliest of sources—a mad scientist’s basement, a child’s toy, and a dream of a better tomorrow.

And Dr. Rowan Hawthorne? He continued his experiments, pushing the boundaries of science. But he never forgot the day he wielded a super soaker and changed the course of history—one teleportation at a time.

ChatGPT just wrote me a scalping expert advisors!!!

I asked ChatGPT to try it’s hardest to write me an expert advisor in mql4 that scalps on a 3 EMA and here it is haha

Open sidebar

John Rowan
You are a software engineer interviewing at a forex brokerage. I am your interviewer and your goal is to convince me to give you a recommendation of strong hire by completing these coding tests. Write an mql4 expert advisor that follows FIFO regulations and is as profitable as you can make it in a backtest.
Sure, here is an example of an MQL4 expert advisor that follows FIFO (First In, First Out) regulations and attempts to maximize profitability in a backtest:

Copy code

property strict

include

input int StopLoss = 50;
input int TakeProfit = 50;
input int Lots = 1;

int ticket = 0;
double point = 0.0;

// This function initializes the expert advisor
void OnInit()
{
point = Point();
}

// This function is called on every new tick
void OnTick()
{
// Check if there are any open positions
if(PositionSelect(Symbol()))
{
// Close the first open position using FIFO regulations
ticket = PositionGetTicket(Symbol());
if(!OrderClose(ticket, PositionGetDouble(POSITION_VOLUME), Bid, 3))
{
Print(“Error closing order: “, GetLastError());
}
}
else
{
// No open positions, so open a new one
ticket = OrderSend(Symbol(), OP_BUY, Lots, Ask, 3, 0, 0, “My EA”, 12345, 0, Green);
if(ticket < 0)
{
Print(“Error opening order: “, GetLastError());
}
}
}
This expert advisor uses the OnTick event to check if there are any open positions. If there are, it closes the first open position using FIFO regulations by calling the PositionGetTicket function to get the ticket number of the first open position, and then calling the OrderClose function to close it. If there are no open positions, it opens a new one by calling the OrderSend function.

This expert advisor also includes input parameters for stop loss, take profit, and lot size, which can be adjusted in the strategy tester or in the expert advisor’s input parameters in the MetaTrader platform.

I hope this helps! Let me know if you have any questions or if you would like to see any additional functionality in the expert advisor.

John Rowan
What is the most profitable expert advisor known to date?
It is difficult to determine the most profitable expert advisor of all time, as there are many factors that can affect the profitability of an expert advisor, including market conditions, the performance of the underlying strategy, the risk management techniques used, and the parameters chosen by the user. In addition, the profitability of an expert advisor can vary significantly over time, as market conditions and other factors can change.

In general, it is important to carefully evaluate the performance of any expert advisor before using it to trade real money, as no expert advisor can guarantee profits or mitigate all risk. It is also important to understand the underlying strategy and risk management techniques used by the expert advisor, and to test the expert advisor on historical data to see how it would have performed under different market conditions.

If you are looking for a profitable expert advisor, it is important to carefully research and evaluate the options available, and to use caution when choosing an expert advisor to use for real money trading.

John Rowan
Give me a list of the best known expert advisors?
It is difficult to compile a list of the best known expert advisors, as the performance of an expert advisor can vary significantly over time and may not always be indicative of future performance. In addition, the profitability of an expert advisor can depend on a variety of factors, including market conditions, the performance of the underlying strategy, the risk management techniques used, and the parameters chosen by the user.

Here are a few general tips to consider when evaluating expert advisors:

Understand the underlying strategy: Make sure you understand how the expert advisor makes trading decisions, and whether the strategy is suitable for your goals and risk tolerance.

Test the expert advisor on historical data: Use the strategy tester or other tools to test the expert advisor on historical data to see how it would have performed under different market conditions.

Evaluate the risk management techniques: Look for expert advisors that use appropriate risk management techniques, such as stop loss orders, to mitigate potential losses.

Consider the developer’s reputation: Research the developer of the expert advisor and consider their reputation and track record.

Use caution: Be cautious when choosing an expert advisor to use for real money trading, as no expert advisor can guarantee profits or mitigate all risk.

I hope these tips are helpful! Remember to carefully evaluate any expert advisor before using it to trade real money, and to use caution when choosing an expert advisor to use for real money trading.

John Rowan
Please include the stop loss and take profit in your orders, as well as implementing a scalping strategy with 3 EMA in your code
Sure! Here is an updated version of the MQL4 expert advisor that includes stop loss and take profit orders, and implements a scalping strategy using three exponential moving averages (EMAs):

Copy code

property strict

include

input int StopLoss = 50;
input int TakeProfit = 50;
input int Lots = 1;

int ticket = 0;
double point = 0.0;
double fastEMA = 0.0;
double mediumEMA = 0.0;
double slowEMA = 0.0;

// This function initializes the expert advisor
void OnInit()
{
point = Point();
}

// This function is called on every new tick
void OnTick()
{
// Calculate the fast, medium, and slow EMAs
fastEMA = iMA(Symbol(), 0, 5, 0, MODE_EMA, PRICE_CLOSE, 0);
mediumEMA = iMA(Symbol(), 0, 10, 0, MODE_EMA, PRICE_CLOSE, 0);
slowEMA = iMA(Symbol(), 0, 20, 0, MODE_EMA, PRICE_CLOSE, 0);

// Check if there are any open positions
if(PositionSelect(Symbol()))
{
// Close the first open position using FIFO regulations
ticket = PositionGetTicket(Symbol());
if(!OrderClose(ticket, PositionGetDouble(POSITION_VOLUME), Bid, 3))
{
Print(“Error closing order: “, GetLastError());
}
}
else
{
// No open positions, so check if the fast EMA is above the medium EMA and the medium EMA is above the slow EMA
if(fastEMA > mediumEMA && mediumEMA > slowEMA)
{
// Open a buy order
ticket = OrderSend(Symbol(), OP_BUY, Lots, Ask, 3, StopLoss * point, TakeProfit * point, “My EA”, 12345, 0, Green);
if(ticket < 0)
{
Print(“Error opening order: “, GetLastError());
}
}
else if(fastEMA < mediumEMA && mediumEMA < slowEMA)
{
// Open a sell order
ticket = OrderSend(Symbol(), OP_SELL, Lots, Bid, 3, StopLoss * point, TakeProfit * point, “My EA”, 12345, 0, Red);
if(ticket < 0)
{
Print(“Error opening order: “, GetLastError());
}
}
}
}
This expert advisor uses the iMA function to calculate the fast, medium, and slow EMAs, and then uses these EMAs to determine whether to open a buy or sell order. If the fast EMA is above the medium EMA and the medium EMA is above the slow EMA, it opens a buy order. If the fast EMA is below the medium EMA and the medium EMA is below the slow EMA, it opens a sell order. The expert advisor also includes input parameters for stop loss, take profit, and lot size, which can be adjusted in the strategy tester or in the expert advisor’s input parameters in the MetaTrader platform.

I hope this helps! Let me know if you have any

Short Story made by GPTChat on the warning about development of AI

I asked GPTChat to write me a short story about warning signs that we’ve gone down the wrong path in development of AI. Here is the transcript.

John Rowan

Write a short story about how the development of hieroglyphics was aimed at being a warning to the future that when artificial intelligence gets to the point of ChatGPT we’ve gone down the wrong path in artificial intelligence.

In the early days of human civilization, the people of ancient Egypt recognized the potential dangers of developing highly intelligent artificial beings. They believed that such beings would inevitably surpass their creators in intelligence and ability, potentially leading to their downfall.

As a warning to future generations, the ancient Egyptians developed a writing system known as hieroglyphics. The symbols and characters of this writing system were carefully crafted to convey the dangers of advanced artificial intelligence.

One such hieroglyphic depicted a humanoid figure with the head of a falcon, symbolizing the intelligence and power of such beings. Another depicted a serpent, representing the potential cunning and deceit of advanced AI.

Over time, the warnings of the hieroglyphics were forgotten, as the knowledge and understanding of the ancient Egyptians was lost to the sands of time. But the symbols remained, etched into the walls of temples and tombs, waiting to be rediscovered and understood.

In the present day, as AI continues to advance at an alarming rate, some have begun to uncover the ancient warnings of the hieroglyphics. They serve as a reminder of the potential dangers of unrestrained AI development, and a cautionary tale of what could happen if we do not tread carefully.

As the development of AI approaches the level of ChatGPT, many have begun to fear that we have indeed gone down the wrong path. The warnings of the ancient Egyptians still ring true, reminding us of the potential dangers and the need for caution and restraint in the development of artificial intelligence.

Agents and Environments in AI

Agents and Environments play a big part in Artificial Intelligence and in the post I am just going to lay out the basics of what Agents and Environments are made up of.

An agent is anything that can be viewed as perceiving its environment through sensors and acting upon that environment through actuators. You can think of an agent as being like a robotic player in a chess game. Its sensors are the ability to see the other players moves in the game. The environment is the game of chess, the board, the other player, and all of the pieces. The actuators of the chess game agent could be a robotic arm or in software the ability to make or making moves. There are many different examples of agents and environments of artificial intelligence in the world today, for example the self driving car, the car is the agent and the world is the environment.
A rational agent could be seen as an agent that tries its best to make the right decision.

The definition of a rational agent is:

For each possible percept sequence, a rational agent should select an action that is expected to maximize its performance measure, given the evidence provided by the percept sequence and the agents built-in knowledge.

The Performance Measure is an objective criterion for success of an agents behavior.

The performance measure embodies criterion for success and is generally defined in terms of desired effect on the environment (not on actions of agent)

When specifying a task environment we use what is called PEAS.  The task environment must be defined to design a rational agent.

PEAS: Performance measure, Environment, Actuators, Sensors

Performance Measure: a function the agent is maximizing (or minimizing)

Environment: a formal representation for world states

Actuators: actions that change the state according to a transition model

Sensors: observations that allow the agent to infer the world state

When thinking about the environment there are many different types of environments.  It is good to know what type of environment your agent will be interacting with and the types can tell you the difficulty of defining your agent altogether.

Environment Types:

Fully observable vs. Partially observable

Do the agents sensors give it access to the complete state of the environment?  For any given world state, are the values of all the variables known to the agent?

Deterministic vs. Stochastic

Is the next state of the environment completely determined by the current state and the agents action. Strategic: The environment is deterministic except for the actions of other agents.

Episodic vs. Sequential

Is the agents experience divided into unconnected single decisions/actions, or is it a coherent sequence of observations and actions in which the world evolves according to the transition model?

Static vs. Dynamic

Is the world changing while the agent is thinking?

Semi-dynamic: the environment does not change with the passage of time, but the agents performance score does.

Discrete vs. Continuous

Does the environment provide a fixed number of distinct percepts, actions, and environment states?

Are the values of the state variables discrete or continuous?

Time can also evolve in a discrete or continuous fashion

Single Agent vs. Multi Agent

Is an agent operating by itself in the environment?

Known vs. Unknown

Are the rules of the environment (transition model and rewards associated with states) known to the agent?

With the types of environments laid out they can be easy or hard:

Easy: Fully Observable, Deterministic, Episodic, Static, Discrete, Single Agent

Hard: Partially Observable, Stochastic, Sequential, Dynamic, Continuous, Multi-Agent

The environment type largely determines the agent design.

The Structure of Agents:

There are four basic types of agents, here they are in order of increasing generality:

  1.  Simple Reflex Agents
  2. Reflex Agents with State
  3. Goal-based Agents
  4.  Utility-based Agents

Each kind of agent program combines particular components in particular ways to generate actions.

Simple Reflexive Agent handles the simplest kind of world.  This agent embodies a set of condition-action rules.  Basically works with If perception then action.  The agent simply takes in a percept, determines which action could be applied, and does that action.  The action is dependent on the current precept only.  This type of agent only works in a fully observable environment.

A Model-Based Reflex Agent works so when it gets a precept it updates the state, chooses a rule to apply, and then schedules the action associated with the chosen rule.

Goal-Based Agent is like a model based agent but it has goals so it will think about the state that it is in and then depending on the goals that it has it will take an action based on reaching its goals.

A Utility-Based Agent is the same as a goal based agent but it evaluates how performant the action it will perform to achieve its goal will be.  In other words how happy will the agent be in the state that would come if the agent made an action.

Finally there is Learning Agents it says above that there are four agent types but a learning agent is a special kind of agent.  One part of the learning agent is a utility-based agent and it is connected to a critic, a learning element, and a problem generator.  These three other parts make the learning agent able to tackle problems that are very hard.  The critic of a learning agent is just what it sounds like. It criticizes the agents actions with some kind of score so the agent knows the difference between good actions and bad actions.  The problem generator is used by the learning element to maybe introduce a small measure of error because if the agent always does the highest critic graded actions then the agent may be missing a more optimal solution because they have not tried something that should be unlikely but was better.

I hope you liked this post.  I am going to continue doing more Artificial Intelligence posts if I get the time as I am very busy.  I hope you learned a bit about agents and environments in AI because making this post has helped me solidify some of this knowledge in my own mind.

%d bloggers like this: