Blog

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.

Orion Nebula

Recently I took a trip to cherry springs state park. There was a full moon but I was excited to try some new equipment that I got.

Orion Nebula

I hope you like this photo. The equipment I was trying out was the Starsense, a focuser and dew heaters with everything being controlled with an Xbox controller with CPWI

Donate or Subscribe to support Copypasteearth!!!!

Γ—
Your Donation

Messier 103

Here are some of the first images I have ever taken when I started astrophotography. These images are of Messier 103. I hope you enjoy them. I took them with my Makustov Cassegrain 7″ and a Cannon 60D camera.

Donate or Subscribe to support Copypasteearth!!!!

Γ—
Your Donation

Whirlpool Galaxy

Here are some pictures of the Whirlpool Galaxy that I took. These are with a Celestron C11, hyperstar, ASI mcpro camera, and guide scope. I tried to use a filter with the hyperstar to reduce the light pollution, but it blocked some colors from coming through. I still think it is a pretty awesome result though. The next time I do this target, I’ll try to get all the color.

I hope you enjoy these pictures. πŸ”­

Donate or Subscribe to support Copypasteearth!!!!

Γ—
Your Donation

Crab Nebula M1

I took this picture a couple years ago around when I first started astrophotography. When I processed all of the data for this picture I was amazed at the result being that this is all unguided 30 second exposures. I used a 7″ MakCass and a Cannon 60D

It’s a little green but I think it’s pretty good for just starting off.

I hope you liked this post!!!!!

Donate or Subscribe to support Copypasteearth!!!!

Γ—
Your Donation

Bodes Nebulae M81

These are pictures of Bodes Nebulae M81 that were taken with a Celestron C11 with a hyperstar, guide scope, asimcpro camera, PHD2 for tracking, Siril stacking, and gimp post processing. My gimp skills aren’t that great yet, but improving.

This is the best post processed one I currently have.

Without post processing

So with the hyperstar, I was only able to do around 15-30 second subs. I think because the Focal ratio is reduced so much that the amount of light it is gathering washes out the exposure quicker. If you have any advice on how I can improve, please leave a comment. Thank you.

Donate or Subscribe to support Copypasteearth!!!!

Γ—
Your Donation

Ring Nebula Messier 57

These are pictures of the Ring Nebula I took with a 7″ MakCass, Cannon 60D, PHD2, OAG. Used Siril for stacking and gimp for postprocessing.

The best post processing I could do.

Zoomed in and cropped.

This is most of the frame

I hope you enjoyed this post. This is a hobby I really enjoy and it is nice to be able to share my progress with you all.

Stay tuned for more astrophotography from copypasteearth.com !!!!!!!!!!πŸ”­πŸ”­πŸ”­πŸ”­πŸ”­πŸ”­πŸ”­πŸ”­πŸ”­πŸ”­πŸ”­πŸ”­πŸ”­πŸ”­πŸ”­πŸ”­πŸ”­πŸ”­πŸ”­πŸ”­πŸ”­πŸ”­πŸ”­πŸ”­πŸ”­πŸ”­πŸ”­πŸ”­πŸ”­πŸ”­πŸ”­πŸ”­πŸ”­πŸ”­πŸ”­πŸ”­πŸ”­πŸ”­πŸ”­πŸ”­πŸ”­πŸ”­πŸ”­πŸ”­πŸ”­πŸ”­πŸ”­

Donate or Subscribe to support Copypasteearth!!!!!!

Γ—
Your Donation

Test Driven Development for Existing Codebases

Test Driven Development or TDD can be a useful deterrent for bugs in huge codebases. Writing tests can get complex when trying to introduce them into an existing codebase, especially if there is tightly coupled classes. One way to start doing TDD in an existing codebase is to start introducing unit tests for each bug that the engineer is working on. Ideally every time an engineer is fixing a bug, they would make the unit test that would verify the expected behavior, then once they have the unit test failing, they would actually fix the bug. If engineers took this approach to start doing TDD in an existing codebase, eventually code coverage will grow as the bugs are resolved one by one.

One problem with introducing TDD into an existing project is the testability of the code. Depending on the quality of the architecture and design patterns used in the codebase and amount of coupling, the engineer might have to do substantial refactoring to make the code testable. Either way refactoring code to be testable is actually a major improvement which will facilitate more ease of development. Other engineers will be more confident that they will not break other parts of code once tests are introduced from other TDD tasks and code coverage climbs.

TDD can be a very powerful way to ensure quality of production code and engineers will have to deal with a great deal less of bugs in the long run. At first doing TDD in an existing codebase will take longer than if it was done since the beginning of writing the application. Once the coverage gets to a certain point in an application, the code should be refactored to be testable enough that engineers will take less time to introduce new tests and code.

Γ—
Your Donation

Smart Thermostats

While doing security research dealing with IOT devices and home security, I decided to look into smart thermostats.  While Googles Nest series of IOT devices seem to have the greatest security built into them it appears that the Google Nest Thermostat has a security vulnerability.  In this day in age even the big companies like Google, Amazon, Samsung, etc.… still have vulnerabilities in their so called β€œSmart” devices.  Even though these big companies still sometimes overlook a vulnerability in their IOT devices, purchasing a device from a big company is probably the consumers best bet in getting the best security tested device.  Google is not a newcomer into the world of security, and they seem to do a very good job of releasing secure devices into the world but the war dealing with computer security is a never-ending battle and sometimes hackers even get one over on Google.  I am a big fan of Google and what they do in the technological world and I have many Google devices powering my home.  Fortunately, I do not have the Google Nest Thermostat and I don’t know if I will ever wind up getting a Smart thermostat anyway.  In this document I will go over what the Google Nest Thermostat is, how this vulnerability can be taken advantage of, and what Google is doing, or the user can do to prevent becoming victim to this vulnerability.

         The Google Nest Thermostat is a smart thermostat that is part of Googles line of IOT devices.  The capabilities of this thermostat are built in WIFI, a temperature sensor, a humidity sensor, 24-bit color display, and is available in 5 different languages (Google, 2020).  If you would like to buy one of these smart thermostats it will cost about $249.00.  Google states on their web site that this thermostat is compatible with 95% of heating and cooling systems.  This thermostats operating system is Linux based and has menus for switching from heating to cooling, access to device settings, energy history, and scheduling (Wikipedia, 2020).  Since its first appearance in the market, it has been given many security updates and to get an update it requires two factor authentications.  This thermostat connects to all other Nest devices through a protocol called Weave that is done over WIFI.

         The vulnerability on the Google Nest thermostat is taken advantage of by connecting to it by the USB port with a flash drive and while holding the power button for 10 seconds a person can inject malicious software into the devices (Wagenseil, 2014).  This malicious software can be of any type mainly botnets or spying software.  Note that to achieve gaining access to this vulnerability the malicious user has to have physical access to the device.  This type of hack was demonstrated by three security researchers at a Blackhat conference on August 7, 2014.  The three researchers’ names were Yier Jin, Grant Hernandez, and Daniel Buentello (Wagenseil, 2014).  The nest thermostat appears to have very good security when it comes to wireless communications, but the USB is quite insecure.  The nest devices know much of a user’s private information like if they are home or not, their postal code, usernames and passwords.  Since it knows this type of information, this vulnerability could be very dangerous if the right hacker gains access to it.  The malicious software injected into the nest thermostat can also be used to gain access to other devices on the network which could be done using an ARP(Address Resolution Protocol) tool (Tilley, 2015).

         The Nest company is trying to become the biggest name in home connected devices.  The company’s founder says that they have a team in place to test for vulnerabilities and that they do extensive testing on all of their devices.  I am sure that after this vulnerability was found out that the Nest company has pushed an update of some sort to patch the device.  The Nest company has also stated that if a hacker has physical access to a device no matter what device it is, that they can potentially hack the device.  To prevent becoming a victim of this type of attack I think the user should always be aware of who they let inside their home.  Since physical access to the device is necessary to exploit this vulnerability, like some other devices I have researched, being aware of who is in your home is a big thing.  The user should always make sure that all of their IOT devices are up to date with the latest security patches.  The reason that the Nest thermostat allows a person to connect with a flash USB and load software onto it is so the firmware can be manually updated.  I guess the Nest company did not see this as a great threat.

         To conclude I would like to state that I like the Google Nest Company.  I think that they are on a solid path to becoming the most used IOT home devices.  I like how all of their devices work together on the same network and I think that the company itself takes great pride in their security practices.  This hack may possibly be an example of something that could be inevitable in the process of designing an IOT device.  Maybe Nest is right that any device can be hacked if a malicious user has physical access to it.  I personally do not have a smart thermostat because I only change the temperature on mine about twice a year, but I love the idea of having your thermostat become smart so that if you are away on vacation or something like that you can control the temperature of your home from far away.

Works Cited

Google. (2020, April 9). Nest Thermostat Specifications. Retrieved from store.google.com: https://store.google.com/us/product/nest_learning_thermostat_3rd_gen_specs

Tilley, A. (2015, March 6). How Hackers Could Use A Nest Thermostat As An Entry Point Into Your Home. Retrieved from forbes.com: https://www.forbes.com/sites/aarontilley/2015/03/06/nest-thermostat-hack-home-network/#788408d39864

Wagenseil, P. (2014, August 7). Nest Smart Thermostat Can Be Hacked to Spy on Owners. Retrieved from tomsguide.com: https://www.tomsguide.com/us/nest-spying-hack,news-19290.html

Wikipedia. (2020, April 9). Nest Learning Thermostat. Retrieved from wikipedia.org: https://en.wikipedia.org/wiki/Nest_Learning_Thermostat#Hardware

Γ—
Your Donation
%d bloggers like this: