Market GPT for a trading edge?

so the other day i broke out an old ai from cray days and decided i would give it a crack.

after decades i have learned to be much more fanatically detailed in my definitions of things.

it actually turned out really well for me, but i think that's only because i already know most of what i'm directing it to accomplish. it is excellent for typing and commenting code and coming up with different ways to code something.

my interest has a new spark.

Did you try another AI for coding?
 
Did you try another AI for coding?

below is code written by chat gpt after some training

Certainly! Here's a code snippet that adds a breakeven stop and a cost-covering mechanism to an existing trading system. It includes input values that can be adjusted:
--------------------------------------------------------------
//powerlanguage
input:
BreakevenEnabled(true), // Enable/disable breakeven stop
BreakevenTicks(2), // Number of ticks to trail for breakeven stop
CostCoverEnabled(true), // Enable/disable cost covering
CostCoverTicks(4); // Number of ticks to cover cost

vars:
EntryPrice(0), // Entry price of the trade
BreakevenTriggered(false), // Flag to track breakeven stop triggered
BreakevenStopPrice(0), // Breakeven stop price
CostCoverPrice(0); // Price to cover the cost

// Place this code in the appropriate section of your trading system
if MarketPosition <> 0 then
begin
if BreakevenEnabled and not BreakevenTriggered then
begin
// Check if the trade is profitable by the number of BreakevenTicks
if MarketPosition = 1 and Close >= EntryPrice + BreakevenTicks * MinMove
or MarketPosition = -1 and Close <= EntryPrice - BreakevenTicks * MinMove then
begin
// Set the breakeven stop price and flag it as triggered
BreakevenStopPrice = EntryPrice;
BreakevenTriggered = true;
end;
end;

if CostCoverEnabled then
begin
// Calculate the cost covering price based on the entry price
if MarketPosition = 1 then
CostCoverPrice = EntryPrice + CostCoverTicks * MinMove
else if MarketPosition = -1 then
CostCoverPrice = EntryPrice - CostCoverTicks * MinMove;

// Check if the current price reaches or exceeds the cost covering price
if MarketPosition = 1 and High >= CostCoverPrice
or MarketPosition = -1 and Low <= CostCoverPrice then
begin
// Exit the position to cover the cost
Sell("CostCover") next bar at market;
end;
end;
end;

// Place this code where you enter a new position
if BreakevenEnabled then
EntryPrice = EntryPrice; // Set the entry price for the trade
else
EntryPrice = EntryPrice; // Set the entry price for the trade

In this code snippet, you can adjust the input values BreakevenEnabled, BreakevenTicks, CostCoverEnabled, and CostCoverTicks to enable/disable the breakeven stop and cost covering, and specify the desired number of ticks for each.

The code first initializes the necessary variables. Within the trading system, it checks if the breakeven stop is enabled and not yet triggered. If the trade becomes profitable by the specified number of ticks, it sets the breakeven stop price and marks it as triggered.

Additionally, if the cost covering is enabled, it calculates the cost covering price based on the entry price and checks if the current price reaches or exceeds it. If so, it exits the position to cover the cost.

Please integrate this code snippet into your existing trading system at appropriate locations for entering new positions and within the section where trade management occurs.

Note that this is a simplified implementation, and you may need to adapt it to your specific trading strategy and platform. Always thoroughly test any modifications and consider the risks involved in trading.
 
What is going on here:

if BreakevenEnabled then
EntryPrice = EntryPrice; // Set the entry price for the trade
else
EntryPrice = EntryPrice; // Set the entry price for the trade
 
Last edited:
below is code written by chat gpt after some training

Certainly! Here's a code snippet that adds a breakeven stop and a cost-covering mechanism to an existing trading system. It includes input values that can be adjusted:
--------------------------------------------------------------
//powerlanguage
input:
BreakevenEnabled(true), // Enable/disable breakeven stop
BreakevenTicks(2), // Number of ticks to trail for breakeven stop
CostCoverEnabled(true), // Enable/disable cost covering
CostCoverTicks(4); // Number of ticks to cover cost

vars:
EntryPrice(0), // Entry price of the trade
BreakevenTriggered(false), // Flag to track breakeven stop triggered
BreakevenStopPrice(0), // Breakeven stop price
CostCoverPrice(0); // Price to cover the cost

// Place this code in the appropriate section of your trading system
if MarketPosition <> 0 then
begin
if BreakevenEnabled and not BreakevenTriggered then
begin
// Check if the trade is profitable by the number of BreakevenTicks
if MarketPosition = 1 and Close >= EntryPrice + BreakevenTicks * MinMove
or MarketPosition = -1 and Close <= EntryPrice - BreakevenTicks * MinMove then
begin
// Set the breakeven stop price and flag it as triggered
BreakevenStopPrice = EntryPrice;
BreakevenTriggered = true;
end;
end;

if CostCoverEnabled then
begin
// Calculate the cost covering price based on the entry price
if MarketPosition = 1 then
CostCoverPrice = EntryPrice + CostCoverTicks * MinMove
else if MarketPosition = -1 then
CostCoverPrice = EntryPrice - CostCoverTicks * MinMove;

// Check if the current price reaches or exceeds the cost covering price
if MarketPosition = 1 and High >= CostCoverPrice
or MarketPosition = -1 and Low <= CostCoverPrice then
begin
// Exit the position to cover the cost
Sell("CostCover") next bar at market;
end;
end;
end;

// Place this code where you enter a new position
if BreakevenEnabled then
EntryPrice = EntryPrice; // Set the entry price for the trade
else
EntryPrice = EntryPrice; // Set the entry price for the trade

In this code snippet, you can adjust the input values BreakevenEnabled, BreakevenTicks, CostCoverEnabled, and CostCoverTicks to enable/disable the breakeven stop and cost covering, and specify the desired number of ticks for each.

The code first initializes the necessary variables. Within the trading system, it checks if the breakeven stop is enabled and not yet triggered. If the trade becomes profitable by the specified number of ticks, it sets the breakeven stop price and marks it as triggered.

Additionally, if the cost covering is enabled, it calculates the cost covering price based on the entry price and checks if the current price reaches or exceeds it. If so, it exits the position to cover the cost.

Please integrate this code snippet into your existing trading system at appropriate locations for entering new positions and within the section where trade management occurs.

Note that this is a simplified implementation, and you may need to adapt it to your specific trading strategy and platform. Always thoroughly test any modifications and consider the risks involved in trading.

invaluable tool for enhancing trading strategies and mitigating risks
 
What is going one here:

if BreakevenEnabled then
EntryPrice = EntryPrice; // Set the entry price for the trade
else
EntryPrice = EntryPrice; // Set the entry price for the trade

as I understand this part of the code can be safely removed without affecting the functionality of the code. However, I could be mistaken.
 
as I understand this part of the code can be safely removed without affecting the functionality of the code. However, I could be mistaken.

yes correct

adds a breakeven stop and a cost-covering mechanism to an existing trading system.
 
GPT is a deep learning model used to generate natural language texts and other types of data. It has been employed in market research to enhance decision-making, provide trading recommendations, and offer analysis tools. However, using GPT for market research poses challenges, including the need for specific prompts, the risk of unreliable outputs, and ethical/legal implications. Traders and investors must exercise caution, supplement GPT's outputs with their own research, and consider the potential implications.
 
best to think of LLM (ie. chatGPT) as a plagiarist. Good for student term papers, "journalists", legal contracts, ...

Exactly. LLMs just process information that is already searchable, it doesn't generate new ideas. This is why it's even bad for legal questions in many countries where the information online is very limited.
 
However, using GPT for market research poses challenges, including the need for specific prompts, the risk of unreliable outputs, and ethical/legal implications.

What legal/ethical challenges? The Facebooks, Googles and Amazons today all run on open source code that they didn't pay even one cent to use it despite they'd face immediate collapse if they were forced to create their own proprietary software. Their ethics only go as far as whatever is trending at the moment - for now it's gender and skin color.
 
What legal/ethical challenges? ........... Their ethics only go as far as whatever is trending at the moment ...........
So which is it? There are no ethics issue or they don't pay attention to them anyway?
 
Back
Top