Blog

Whirlpool Galaxy

Another trip to Cherry Springs State Park. Here is the Whirlpool Galaxy. With a C11 scope, 102×30″ each using a hyper star.

Crop (x=279, y=54, w=7915, h=5403) Histogram Transf. (mid=0.001, lo=0.031, hi=1.000)

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
%d bloggers like this: