Hi there,

Thanks for sharing your strategy about ‘hollow frames’ — I find it intriguing and agree that it could be an effective way to help AI understand the overarching scheme of a project. It’s an interesting workaround for AI to manage large-scale projects and zoom into more granular function creation.

Your idea of carrying down relevant points to a granular level resonates with me. This tactic of maintaining context and clarity is something I also see as crucial when working with GPT-4, and your approach provides a valuable perspective on how this can be achieved.

Your mention of including necessary libraries, helper functions, and coding standards is another key point that I completely agree with. Managing these aspects well can indeed guide the AI to generate more accurate and relevant code.

I’m looking forward to further discussions about strategies for guiding AI in code generation and the use of ‘hollow frames’ in large-scale projects. Count me in for any conversations on this!

Best regards

1 Like

That sounds like an amazing project you’ve got going on! Utilizing OpenAI to create a software project estimation app is indeed a genius idea. It seems like a great way to maximize efficiency and make the most out of your team’s time and talents.

On the other hand, I understand your cautious approach towards AutoAGI and BabyAGI. I shared similar reservations when they first launched - the cost seemed quite high and the potential for hallucinations was a bit off-putting.

However, it’s hard not to feel excited about the future possibilities these tools bring to the table! As they evolve and improve, they could become incredibly powerful tools for a wide variety of applications. Looking forward to seeing where these advancements will take us.

Best of luck with your project!

I would be thrilled to join and contribute to the shared learnings and problem solving. I wholeheartedly agree that we can learn a lot from each other and drive innovation forward through collaborative discussions.

However, I would like to bring up that while I can read and write in English, I sometimes struggle with oral comprehension, especially with different accents. But don’t worry, I’m still very enthusiastic about participating in these events. I can provide my feedback and share my insights in written format or in a prepared oral presentation.

Looking forward to this collaborative journey. I will reach out to you on LinkedIn with the note ‘MasterMind’ as you’ve mentioned.

1 Like

Hello! New to the forums but I’ve been working with ChatGPT for the past 2 months. Sent you a connect on linkedin and would love to work with you on this!

I totally agree how exciting it all is. I expect the hallucination issues will resolve to a level frequency in which we can each create architectural approaches to mitigate their negative affect. I really liked the conversation about “hollow frames” and zooming into granular functionality.

If you’re interested, please connect with me on LinkedIn /dhirschfeld with “mastermind” in the request. I would like to start a mastermind where we zoom periodically and share what we’re doing and problem solve. I have two other so far.

3 Likes

The first app I created was in COBOL (or, was it Basic?) a long, long time ago. I developed the habit of flowcharting the business logic of the entire app, then tackling one component at a time.

I now develop in PHP, and specifically in the Drupal-sphere. I use GPT4 Codex daily, primarily to help design and code functions within those components. Of course, the coding by itself is a big help. But, anyone who knows Drupal knows it’s this massive infrastructure of code with an incredible wealth of features and capabilities, and a frustrating lack of good documentation. Here is where GPT4 Codex shines. Not only does it help me navigate and understand the myriad of structures: modules, controllers, services, classes, methods, twigs, content types, routes, listeners, publishers, plugins, fields, views, forms, hooks, etc…, it also can figure out how to use modules with zero documentation by examining the source code.

I wrote an entire chat completion system (ingestion, embedding and query) from scratch, in PHP, using LangChain methodology, that works within the Drupal framework as a module. All of the LangChain examples are in Python, so I had to figure out the individual processes and duplicate them in PHP. If I did not have GPT4 Codex, and could only rely on Google, YouTube, Drupal Issue Queues and Stack Overflow (Drupal Answers), I would never have been able to do it. Not alone, and certainly not under 6 months.

So, yeah, I don’t know how much deeper in the trenches it gets than this.

In my experience, breaking your logic down into the smallest pieces of logic possible, GPT4 Codex is simply amazing at building those functions for you. Of course, the larger the functions (the more code), the less reliable it gets. I’ve gotten the best performance with smaller functions and making my overall code as modular as possible.

5 Likes

I’d love GPT to offer code by default with “tab” indentation instead of “space” indentation since the game engine I use (Godot) uses only tab indentation. I’m not sure if there are languages that don’t accept code with tab indentation. If all scripting languages accept “tab” indentation and not all the languages accept “space” indentation, then why not by default generate code only with “tab” indentation?

Highly appreciate the work of guys and girls behind GPT! You are doing mega job for humanity!

1 Like

It would be trivial to ask ChatGPT to create you some python code to do exact that from a copy pasted section of text.

It’s been a great help to write code snippets that saves a lot of time.

One thing I noticed is that when the code snippet gets too long, the more the code becomes prone to errors. I then have to copy-paste snippets of code in different chats to debug.

Oftentimes, copy-pasting in a new chat works better for me to debug issues / bugs.

My experience for doing a test project with ChatGPT was as follows:

  1. At first, I explained the project name and ultimate goal for ChatGPT.
  2. I gave him a clear definition of the project architecture.
  3. I specified the programming language and frameworks that should be used for both the front end and the database.
  4. Next, I informed ChatGPT that I would define the project using scrum stories and he would generate the classes for each individual module.
  5. I listed different stories for him.
  6. Finally, I defined each story in detail for ChatGPT and it generated the codes of each class for a module.
2 Likes

I noticed the same problems as you. The new interpreter code seems to have more context. I also import the structure of my project in a .txt file so that it can follow throughout the conversation. It seems to be working pretty well for now. I’ll keep you up-to-date

Awesome ! I think this is good practice. With the arrival of code interpreter I try to do the same thing but in a .txt file that I give him from the beginning. I feel like the information stays better in context.

Hi ! I think as another user said that you could ask gpt directly! It is very good for this kind of modification. Moreover, in view of my tests, I can only advise you to use code interpreter to code with chat gpt. The context is much more important and I have the impression that the model is not the same (it performs better).

Like Foxabilo and david23, I have been working on a deep project (all Python so far). As others have mentioned, AutoGPT, etc., are difficult to control. I have also found them difficult to modify. (gpt-engineer was actually pretty easy to modify, but I did not take much if any code from that one either.) I also spent a couple days messing around with LangChain, but ultimately decided to roll my own similar features. I will share my code on github if/when I think it is alpha-worthy.

The project interacts with git, reads and writes code, summarizes code (in multiple ways), and extracts relevant code for a given query or project using multiple prompt/completions. Currently I am focussing on the summaries (and recursive summary of summaries).

As I’m sure you are all finding, t is very challenging to get GPT to respond consistently to a given prompt. Here are some guidelines that have helped me:

  1. Ask for the result in a Python codeblock. Even if you ask gpt not to include anything else, it will often introduce and/or summarize the block. Fortunately, t is easy enough to parse a docstring from a completion. This can be helpful even if your desired completion is not code. Putting it in a python docstring, json, or other structured format helps isolate it so it can be somewhat easily and consistently extracted. I tend to have the model create its completions in Python because GPT’s training data includes more Python code than it does any other language. I’ve verified this online and with GPT itself, so I am fairly confident it is the case. Also, it seems to be much more consistent when producing Python codeblocks. Although it is also highly trained on JSON as well, I’ve found a request for a completion in a Python dictionary to produce consistently better results than a request for a JSON completion.

  2. Add a couple iterations to your prompt for challenging prompts. I’ve been playing around with ChatGPT in this regard, trying to discover whether the Internet application tries to do any summarizing, or delineation. I am relatively convinced (with ChatGPT’s assurances), that the string it gets for its prompt is just a concatenation of the prompts and completions without any delineation, summarization, or extra information for, e.g., delineation of previous prompts and completions. ChatGPT also claims that this is true for the API as well, and all the various “roles” are just ignored and concatenated. Here is a related conversation if anyone is interested:

  1. Keep the prompts relatively simple. GPT4 struggles with abstract concepts such as metacode if it gets too deep. It also struggles to learn and adequately apply anything deep that is not well represented in its training.

  2. Be careful when automatically iterating on errors. Having GPT iterate (take suggestion, provide next error message) on many errors without careful supervision can lead to a wormhole that makes the code much worse than it was when you started (even if the code was previously created by GPT in the same conversation).

  3. Using graph databases or vector databases like Pinecone or Deep Lake can be powerful mechanisms for searches. I have some success with them; however, I am currently focused on creating hierarchical summaries as I have a theory that it will ultimately provide a “truer” set for a given prompt. This seems to be the real challenge to me so far, i.e., automatically generating the correct prompt for a given user request.

  4. If it is not too much trouble, tell GPT how to implement things. Prompts like specs for an intern work pretty well. If this is not practical, it can also be helpful (as many prompt guidelines specify) to tell it to “reason” first. What to “reason” about will vary with the desired completion, but it might be something like, “First explain the details of the related functions and how they interact.” or something like that. As GPT produces a completion if it is able to get a deeper understanding of a previous part of a prompt and put it in the completion, it, in essence becomes a valuable part of the prompt (since it is working on each next token based on all the previous tokens both in the prompt and the completion).

  5. Be very clear and concise especially with examples. I have often seen GPT extract way too much from the examples, especially if the example is longer than the prompt. For example, if an example is intended to show GTP how to extract class definitions, GPT will often complete a prompt that is presenting code without class definitions as if the prompt was the example. Here is an example of something that would hallucinate answers for short prompts that included the specific data from the example. This happened frequently for short prompts even though a short prompt example was provided. Below is a portion of a prompt template that provides a specific set of examples for a specific type of prompt (a prompt to extract classes in this case), and although it worked well for long prompts, it frequently failed miserably in many cases for short prompts.

class_examples = ‘’’
Example1:
----ContentFile-------
#an iterative loop that processes vector data in a graph

ChatGPT:

classes = {}

Example2:
----ContentFile-------
import os
class DatabaseTransformer:
def init(self, root_dir):
self.root_dir = root_dir
def transform(self, *actions):
“”"
Applies a series of actions (transfer functions) to a database.
This method performs a depth-first traversal of the database and applies the transformations to each directory. Each transformation is an instance of a class that derives from the Action class.
Parameters
----------
*actions : list
A list of instances of classes that derive from the Action class.
“”"
for actionable_dir, _, _ in os.walk(self.root_dir, topdown=False):
for action in actions:
action.execute(actionable_dir)
class Action:
def execute(self, actionable_dir):
raise NotImplementedError

ChatGPT:

classes = {
    'DatabaseTransformer': {
        'detailed_description': "The `DatabaseTransformer` class is designed to apply a series of transformation actions to a database. The database is represented as a directory structure. The transformations are applied to each directory in the structure, using a depth-first traversal. The transformations are instances of classes that inherit from the `Action` class.",
        'methods': {
            '__init__': {
                'detailed_description': "The constructor method for the `DatabaseTransformer` class. It takes one argument, `root_dir`, which represents the root directory of the database. The `root_dir` is stored as an instance attribute.",
                'parameters': {
                    'root_dir': "The root directory of the database."
                },
                'returns': "An instance of `DatabaseTransformer` class."
            },
            'transform': {
                'detailed_description': "The ...
1 Like

lol, the forum interface extracted delimiters, so the example is missing some, but hopefully the point is not too obfuscated. i also had this issue creating the examples since there were so many layered delimiters. there’s probably a guideline in that somewhere as well.

Here is a picture that shows the first part of the example (of what not to do) more clearly:

(A picture of the first part of the example of “what not to do”.)

1 Like

I use ChatGPT to program bots for cTrader in C# (never programmed in C# before). It takes a little time and a lot of discussion with the AI until it generates the correct code. However, I’ve noticed that with vague instructions, it generates anything, including parts of the code that were already working. The prompts are very important. But IT works. The result:

using System;
using cAlgo.API;
using cAlgo.API.Indicators;
using cAlgo.API.Internals;
using cAlgo.Indicators;
using static System.Net.Mime.MediaTypeNames;

namespace cAlgo.Robots
{
    [Robot(TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
    public class SamplecBot : Robot
    {

        public string BotName = "ChatGPT New cBot(20)";
        public string BotVersion = "1.20.1";

        // Grundlegende Parameter
        [Parameter("1-Base Quantity (Lots)", Group = "Volume", DefaultValue = 0.5, MinValue = 0.01)]
        public double BaseQuantity { get; set; }
        [Parameter("2-Label Name", Group = "Volume", DefaultValue = "My Order")]
        public string LabelName { get; set; }

        //Short Aktivieren
        [Parameter("Short Aktivieren", Group = "Volume", DefaultValue = true)]
        public bool ActivateShort { get; set; }

        //Long Aktivieren
        [Parameter("Long Aktivieren", Group = "Volume", DefaultValue = true)]
        public bool ActivateLong { get; set; }

        // Short- TP /SL / TSL    -----------------------------------------------------------------------------------------------------------------------------------

        [Parameter("S1--Take Profit (Pips)", Group = "Short Value TP/SL/TSL", DefaultValue = 90)]
        public int ShortTakeProfitInPips { get; set; }

        [Parameter("S2-Trailing Stop at Profit (Pips)", Group = "Short Value TP/SL/TSL", DefaultValue = 15)]
        public int ShortActivateTrailingStopAtProfitInPips { get; set; }

        [Parameter("S3-Trailing Stop (Pips)", Group = "Short Value TP/SL/TSL", DefaultValue = 15)]
        public int ShortTrailingStopInPips { get; set; }

        [Parameter("S4-Stop Loss (Pips)", Group = "Short Value TP/SL/TSL", DefaultValue = 51)]
        public int ShortUnconditionalStopLossInPips { get; set; }


        [Parameter("Activate First SL", Group = "Short SAVE SL", DefaultValue = true)]
        public bool ShortSLJaNein { get; set; }

        [Parameter("S5-Safe SL at Profit (Pips)", Group = "Short SAVE SL", DefaultValue = 15)]
        public int ShortActivateSaveStopAtProfitInPips { get; set; }

        [Parameter("S-6Safe SL Stop (Pips)", Group = "Short SAVE SL", DefaultValue = 15)]
        public int ShortSaveStopInPips { get; set; }


        // Long- TP /SL / TSL     -----------------------------------------------------------------------------------------------------------------------------------


        [Parameter("L1-Take Profit (Pips)", Group = "Long Value TP/SL/TSL", DefaultValue = 68)]
        public int LongTakeProfitInPips { get; set; }

        [Parameter("L2-Trailing Stop at Profit (Pips)", Group = "Long Value TP/SL/TSL", DefaultValue = 45)]
        public int LongActivateTrailingStopAtProfitInPips { get; set; }

        [Parameter("L3-Trailing Stop (Pips)", Group = "Long Value TP/SL/TSL", DefaultValue = 15)]
        public int LongTrailingStopInPips { get; set; }

        [Parameter("L4-Stop Loss (Pips)", Group = "Long Value TP/SL/TSL", DefaultValue = 47)]
        public int LongUnconditionalStopLossInPips { get; set; }

        [Parameter("Activate First SL", Group = "Long SAVE SL", DefaultValue = true)]
        public bool LongtSLJaNein { get; set; }

        [Parameter("L5-Save SL at Profit (Pips)", Group = "Long SAVE SL", DefaultValue = 7)]
        public int LongActivateSaveStopAtProfitInPips { get; set; }

        [Parameter("L6-Save Stop (Pips)", Group = "Long SAVE SL", DefaultValue = 3)]
        public int LongSaveStopInPips { get; set; }


        // SHORT Trading Paramter

        [Parameter("MA Fast Periods", Group = "Short Value", DefaultValue = -1)]
        public int ShortMaFastPeriods { get; set; }

        [Parameter("MA Slow Periods", Group = "Short Value", DefaultValue = 18)]
        public int ShortMaSlowPeriods { get; set; }

        [Parameter("MACD Long Cycle", Group = "Short Value", DefaultValue = 7)]
        public int ShortMacdLongCycle { get; set; }

        [Parameter("MACD Short Cycle", Group = "Short Value", DefaultValue = 5)]
        public int ShortMacdShortCycle { get; set; }

        [Parameter("MACD Signal Periods", Group = "Short Value", DefaultValue = 9)]
        public int ShortMacdSignalPeriods { get; set; }

        [Parameter("RSI Periods", Group = "Short Value", DefaultValue = 16)]
        public int ShortRsiPeriods { get; set; }

        [Parameter("Stochastic Periods", Group = "Short Value", DefaultValue = 13)]
        public int ShortStochasticPeriods { get; set; }

        [Parameter("Stochastic K Slow Periods", Group = "Short Value", DefaultValue = 9)]
        public int ShortStochasticKSlowPeriods { get; set; }

        [Parameter("Stochastic D Slow Periods", Group = "Short Value", DefaultValue = 5)]
        public int ShortStochasticDSlowPeriods { get; set; }

        [Parameter("CCI Periods", Group = "Short Value", DefaultValue = 22)]
        public int ShortCciPeriods { get; set; }

        [Parameter("Momentum Periods", Group = "Short Value", DefaultValue = 15)]
        public int ShortMomentumPeriods { get; set; }

        // Long-Parameter   

        [Parameter("MA Fast Periods", Group = "Long Value", DefaultValue = 9)]
        public int LongMaFastPeriods { get; set; }

        [Parameter("MA Slow Periods", Group = "Long Value", DefaultValue = 21)]
        public int LongMaSlowPeriods { get; set; }

        [Parameter("MACD Long Cycle", Group = "Long Value", DefaultValue = 26)]
        public int LongMacdLongCycle { get; set; }

        [Parameter("MACD Short Cycle", Group = "Long Value", DefaultValue = 12)]
        public int LongMacdShortCycle { get; set; }

        [Parameter("MACD Signal Periods", Group = "Long Value", DefaultValue = 9)]
        public int LongMacdSignalPeriods { get; set; }

        [Parameter("RSI Periods", Group = "Long Value", DefaultValue = 14)]
        public int LongRsiPeriods { get; set; }

        [Parameter("Stochastic Periods", Group = "Long Value", DefaultValue = 14)]
        public int LongStochasticPeriods { get; set; }

        [Parameter("Stochastic K Slow Periods", Group = "Long Value", DefaultValue = 3)]
        public int LongStochasticKSlowPeriods { get; set; }

        [Parameter("Stochastic D Slow Periods", Group = "Long Value", DefaultValue = 3)]
        public int LongStochasticDSlowPeriods { get; set; }

        [Parameter("CCI Periods", Group = "Long Value", DefaultValue = 20)]
        public int LongCciPeriods { get; set; }

        [Parameter("Momentum Periods", Group = "Long Value", DefaultValue = 14)]
        public int LongMomentumPeriods { get; set; }
        //
        // Gemeinsame Parameter

        /*
        [Parameter("Profit Increase Percentage (%)", Group = "==== COMMON ====", DefaultValue = 11.8)]
        public double ProfitIncreasePercentage { get; set; }
        */
        [Parameter("Max Spread (Pips)", Group = "==== COMMON ====", DefaultValue = 13)]
        public int MaxSpreadInPips { get; set; }

        [Parameter("Max Positions", Group = "==== COMMON ====", DefaultValue = 8)]
        public int MaxPositions { get; set; }

        [Parameter("Period Next Trade", Group = "==== COMMON ====", DefaultValue = 4)]
        public int PeriodNextTrade { get; set; }



        //  Variablen für Long & Short


        private double _currentQuantity;
        private int LastPositionOpenedOnBar;

        private MovingAverage _shortMaFast;
        private MovingAverage _shortMaSlow;
        private MacdHistogram _shortMacd;
        private RelativeStrengthIndex _shortRsi;
        private StochasticOscillator _shortStochastic;
        private CommodityChannelIndex _shortCci;
        private MomentumOscillator _shortMomentum;

        private MovingAverage _longMaFast;
        private MovingAverage _longMaSlow;
        private MacdHistogram _longMacd;
        private RelativeStrengthIndex _longRsi;
        private StochasticOscillator _longStochastic;
        private CommodityChannelIndex _longCci;
        private MomentumOscillator _longMomentum;

        protected override void OnStart()
        {

            // DEBUGGER  ON OFF
            //   System.Diagnostics.Debugger.Launch();


            string botInfo = $"{BotName} Version: {BotVersion}";
            Chart.DrawStaticText("botInfo", botInfo, VerticalAlignment.Top, HorizontalAlignment.Left, Color.Black);

            // Initialisierung der Indikatoren
            _shortMaFast = Indicators.MovingAverage(Bars.ClosePrices, ShortMaFastPeriods, MovingAverageType.Exponential);
            _shortMaSlow = Indicators.MovingAverage(Bars.ClosePrices, ShortMaSlowPeriods, MovingAverageType.Exponential);
            _shortMacd = Indicators.MacdHistogram(ShortMacdLongCycle, ShortMacdShortCycle, ShortMacdSignalPeriods);
            _shortRsi = Indicators.RelativeStrengthIndex(Bars.ClosePrices, ShortRsiPeriods);
            _shortStochastic = Indicators.StochasticOscillator(ShortStochasticPeriods, ShortStochasticKSlowPeriods, ShortStochasticDSlowPeriods, MovingAverageType.Simple);
            _shortCci = Indicators.CommodityChannelIndex(ShortCciPeriods);
            _shortMomentum = Indicators.MomentumOscillator(Bars.ClosePrices, ShortMomentumPeriods);

            _longMaFast = Indicators.MovingAverage(Bars.ClosePrices, LongMaFastPeriods, MovingAverageType.Exponential);
            _longMaSlow = Indicators.MovingAverage(Bars.ClosePrices, LongMaSlowPeriods, MovingAverageType.Exponential);
            _longMacd = Indicators.MacdHistogram(LongMacdLongCycle, LongMacdShortCycle, LongMacdSignalPeriods);
            _longRsi = Indicators.RelativeStrengthIndex(Bars.ClosePrices, LongRsiPeriods);
            _longStochastic = Indicators.StochasticOscillator(LongStochasticPeriods, LongStochasticKSlowPeriods, LongStochasticDSlowPeriods, MovingAverageType.Simple);
            _longCci = Indicators.CommodityChannelIndex(LongCciPeriods);
            _longMomentum = Indicators.MomentumOscillator(Bars.ClosePrices, LongMomentumPeriods);

            _currentQuantity = BaseQuantity;
        }




        protected override void OnBar()
        {

            foreach (var position in Positions)
            {
                if (Symbol.Spread / Symbol.PipSize > MaxSpreadInPips) return; // Max Spread Kontrolle

                if (Positions.Count >= MaxPositions && position.SymbolName == SymbolName) return; // Max Position Kontrolle

                if (Bars.ClosePrices.Count - LastPositionOpenedOnBar <= PeriodNextTrade) return; // Wenn weniger als x Kerzen seit der letzten Positionseröffnung vergangen sind, tun Sie nichts
            }

            _currentQuantity = BaseQuantity;

            /*
            In diesem Code fließen alle Bedingungen mit einem bestimmten Gewicht in das Gesamtgewicht ein. 
            Wenn das Gesamtgewicht größer oder gleich 0.6 ist (was bedeutet, dass mindestens drei der sechs Bedingungen erfüllt sind, 
            wenn wir davon ausgehen, dass alle Bedingungen gleich wichtig sind), führt der Algorithmus den Short od Long Trade aus.
            */


            //Short Bedinungen 

            bool isShortTrend = _shortMaFast.Result.LastValue < _shortMaSlow.Result.LastValue;
            bool isShortMacdCondition = _shortMacd.Histogram.LastValue < 0 && _shortMacd.Signal.LastValue > 0;
            bool isShortRsiCondition = _shortRsi.Result.LastValue > 80;
            bool isShortStochasticCondition = _shortStochastic.PercentK.LastValue > 80 && _shortStochastic.PercentD.LastValue > 80;
            bool isShortCciCondition = _shortCci.Result.LastValue > 100;
            bool isShortMomentumCondition = _shortMomentum.Result.LastValue < 0;

            double totalWeightShort = 0.0;
            totalWeightShort += isShortTrend ? 0.2 : 0.0;
            totalWeightShort += isShortMacdCondition ? 0.2 : 0.0;
            totalWeightShort += isShortRsiCondition ? 0.2 : 0.0;
            totalWeightShort += isShortStochasticCondition ? 0.2 : 0.0;
            totalWeightShort += isShortCciCondition ? 0.1 : 0.0;
            totalWeightShort += isShortMomentumCondition ? 0.1 : 0.0;

            // Long Bedinungen 

            bool isLongTrend = _longMaFast.Result.LastValue > _longMaSlow.Result.LastValue;
            bool isLongMacdCondition = _longMacd.Histogram.LastValue > 0 && _longMacd.Signal.LastValue < 0;
            bool isLongRsiCondition = _longRsi.Result.LastValue < 20;
            bool isLongStochasticCondition = _longStochastic.PercentK.LastValue < 20 && _longStochastic.PercentD.LastValue < 20;
            bool isLongCciCondition = _longCci.Result.LastValue < -100;
            bool isLongMomentumCondition = _longMomentum.Result.LastValue > 0;

            double totalWeightLong = 0.0;
            totalWeightLong += isLongTrend ? 0.2 : 0.0;
            totalWeightLong += isLongMacdCondition ? 0.2 : 0.0;
            totalWeightLong += isLongRsiCondition ? 0.2 : 0.0;
            totalWeightLong += isLongStochasticCondition ? 0.2 : 0.0;
            totalWeightLong += isLongCciCondition ? 0.1 : 0.0;
            totalWeightLong += isLongMomentumCondition ? 0.1 : 0.0;


            if (totalWeightShort >= 0.6)
            {
                if (!ActivateShort)
                {
                    return;
                }
                var tradeResult = ExecuteMarketOrder(TradeType.Sell, SymbolName, 1 * Symbol.LotSize * _currentQuantity, LabelName, ShortUnconditionalStopLossInPips, ShortTakeProfitInPips);
                if (tradeResult.IsSuccessful)
                {
                    tradeResult.Position.ModifyStopLossPrice(tradeResult.Position.EntryPrice + ShortUnconditionalStopLossInPips * Symbol.PipSize);
                    LastPositionOpenedOnBar = Bars.ClosePrices.Count; // Aktualisieren Sie die Position der letzten Positionseröffnung
                }
            }

            if (totalWeightLong >= 0.6)

            {
                if (!ActivateLong)
                {
                    return;
                }
                var tradeResult = ExecuteMarketOrder(TradeType.Buy, SymbolName, 1 * Symbol.LotSize * _currentQuantity, LabelName, LongUnconditionalStopLossInPips, LongTakeProfitInPips);
                if (tradeResult.IsSuccessful)



                {
                    tradeResult.Position.ModifyStopLossPrice(tradeResult.Position.EntryPrice - LongUnconditionalStopLossInPips * Symbol.PipSize);
                    LastPositionOpenedOnBar = Bars.ClosePrices.Count; // Aktualisieren Sie die Position der letzten Positionseröffnung

                }
            }
        }

        protected override void OnTick()
        {
            foreach (var position in Positions)
            {
                if (position.SymbolName != SymbolName) continue;

                if (position.TradeType == TradeType.Buy)
                {

                    // Save SL Aktivieren 

                    if (LongtSLJaNein)
                    {

                        if (position.Pips >= LongActivateSaveStopAtProfitInPips || position.Pips <= LongActivateSaveStopAtProfitInPips)
                        {

                            var newStopLossPrice = position.EntryPrice + (LongSaveStopInPips * Symbol.PipSize);

                            position.ModifyStopLossPrice(newStopLossPrice);
                        }
                    }
                    // Save SL Ende

                    if (position.Pips >= LongActivateTrailingStopAtProfitInPips && position.StopLoss == LongUnconditionalStopLossInPips || position.Pips == LongActivateSaveStopAtProfitInPips)
                    {
                        var newStopLossPrice = position.EntryPrice + (LongTrailingStopInPips * Symbol.PipSize);

                        // Setzen Sie den Stop-Loss das erste Mal
                        position.ModifyStopLossPrice(newStopLossPrice);
                    }
                    if (position.Pips >= LongActivateTrailingStopAtProfitInPips && position.StopLoss == null)
                    {
                        //    var newStopLossPrice = position.EntryPrice + (LongTrailingStopInPips * Symbol.PipSize);
                        var newStopLossPrice = Math.Max(position.EntryPrice + LongTrailingStopInPips * Symbol.PipSize, Symbol.Bid - LongTrailingStopInPips * Symbol.PipSize);

                        // Setzen Sie den Stop-Loss das erste Mal in Bezug auf den Kaufpreis
                        position.ModifyStopLossPrice(newStopLossPrice);
                    }
                    else if (position.StopLoss != null && Symbol.Ask > position.StopLoss && position.Pips >= LongActivateTrailingStopAtProfitInPips)
                    {
                        //  var newStopLossPrice = Symbol.Ask - (LongTrailingStopInPips * Symbol.PipSize);
                        var newStopLossPrice = Math.Max(position.EntryPrice + LongTrailingStopInPips * Symbol.PipSize, Symbol.Bid - LongTrailingStopInPips * Symbol.PipSize);

                        // Überprüfen Sie, ob der neue Stop-Loss-Preis höher ist
                        if (newStopLossPrice > position.StopLoss)
                        {
                            position.ModifyStopLossPrice(newStopLossPrice);
                        }
                    }
                }
                //************************************************************************* Short TP TSL**************************************************

                else if (position.TradeType == TradeType.Sell)
                {

                    //Save SL Aktivieren  Start 

                    if (ShortSLJaNein)
                    {
                        if (position.Pips >= ShortActivateSaveStopAtProfitInPips || position.StopLoss <= ShortUnconditionalStopLossInPips)
                        {

                            var newStopLossPrice = position.EntryPrice - (ShortSaveStopInPips * Symbol.PipSize);

                            position.ModifyStopLossPrice(newStopLossPrice);
                        }
                    }

                    //Save SL Aktivieren  Ende 

                    if (position.Pips >= ShortActivateTrailingStopAtProfitInPips && position.StopLoss == ShortUnconditionalStopLossInPips)
                    {
                        var newStopLossPrice = position.EntryPrice + (ShortTrailingStopInPips * Symbol.PipSize);

                        // Setzen Sie den Stop-Loss das erste Mal
                        position.ModifyStopLossPrice(newStopLossPrice);
                    }

                    if (position.Pips >= ShortActivateTrailingStopAtProfitInPips && position.StopLoss == null)
                    {
                        var newStopLossPrice = position.EntryPrice + (ShortTrailingStopInPips * Symbol.PipSize);

                        // Setzen Sie den Stop-Loss das erste Mal in Bezug auf den Verkaufspreis
                        position.ModifyStopLossPrice(newStopLossPrice);
                    }
                    else if (position.StopLoss != null && Symbol.Bid < position.StopLoss && position.Pips >= ShortActivateTrailingStopAtProfitInPips)
                    {
                        var newStopLossPrice = Symbol.Bid + (ShortTrailingStopInPips * Symbol.PipSize);

                        // Überprüfen Sie, ob der neue Stop-Loss-Preis niedriger ist
                        if (newStopLossPrice < position.StopLoss)
                        {
                            position.ModifyStopLossPrice(newStopLossPrice);
                        }
                    }
                }


            }
        }
    }
}
1 Like

If it takes me more than 30 seconds to solve it, it is necessary to ask GPT, about whether I use any methodology in practice, the truth is that I don’t. To solve problems that arise in my day-to-day life as a developer, my strategy would be to have more clarity on the prompts that I should use in each case, but most of the time I solve it with ChatGPT.

Hi there,

I’m writing an Android app. I’m using GPT4 for all of my coding and it is saving me an amazing amount of time and effort. It makes mistakes fairly often, but they are usually easy to pick up and the benefit is enormous. I specifically limit it to coding snippets and small functions that I flesh out piece by piece without giving GPT4 overall control. I use ChatGPT rather than a copilot arrangement, and it works fine.

I am also using the GPT4 API in the app I am writing, so GPT4 is heavily involved the content of what I am writing, as well as assisting with the writing.

I have two main complaints about the service provided, though I do understand it is related to resource limits.

Firstly, the API is incredibly slow to respond, taking minutes to generate a short response, even though the same query would be very fast through the non-API, ChatGPT service. It would literally be quicker if I wrote a bot that opened the browser and sent my query through ChatGPT instead of using the API. This will be a major barrier to acceptance of my app in the marketplace, as users will not want to wait minutes for a simple response.

Secondly, the context limits are quite severe. My app involves writing stories for children, and by the time I enter the user prompt and give editorial guidance to GPT, the token budget does not leave room for much of a story.

The app is nearly finished, and I think it has enormous potential as an app to foster imagination in children. It is specifically targeted at pre-literate children, using picture icons and voice recognition. The app would have huge potential if I had fast responses and 32k access, bringing GPT4 into the mobile devices of parents everywhere, but it will be a hard sell under the current constraints. I also have a variant for adults, creating narrated dream sequences on demand, but the slowness and context budget limit the appeal there, too.

I am pressing on in the hope that the speed and context will both improve soon. This app will really come into its own when GPT4.5 or 5 comes out, as it pushes the limits of what GPT4 can do, but 32k GPT4 would be awesome.

just out of curiosity, has anyone tried few shot prompting, for example gives model samples of abstract class, and explain how they interact with each other, system design pattern for different use case, and then ask model to create skeleton of the app.
also gpt-4 is not software engineering specific model, is there any model trained specifically for software engineering?