Trading the forex fully automated martingale

chatgpt, can you write a program that is written using microsoft quickc for dos that is a basic incremental dialer similar to that which was in the war games movie and can you design it as a state machine using the switch statement?

ChatGPT said:​


Sure, Edward! Below is a simple incremental dialer program written in C using Microsoft QuickC for DOS. It simulates dialing through a sequence of numbers (like in WarGames).
The design will follow a state machine pattern implemented with a switch statement. We'll keep it simple, incrementing numbers from a given starting point, simulating dialing them, and printing them to the screen.

Code: Incremental Dialer in Microsoft QuickC (DOS)​


#include <stdio.h>
#include <conio.h> // for _kbhit() and getch()
#include <dos.h> // for delay()

// State definitions for the state machine
typedef enum {
STATE_IDLE, // Waiting for user to start dialing
STATE_DIALING, // Actively dialing numbers
STATE_PAUSED, // Paused by user
STATE_EXIT // Exit the program
} DialerState;

void delay_ms(unsigned int milliseconds) {
// Simple delay function to simulate dialing speed
delay(milliseconds);
}

int main() {
DialerState state = STATE_IDLE; // Initial state
unsigned int startNum = 5550000; // Start of the number range (7-digit phone numbers)
unsigned int endNum = 5559999; // End of the number range
unsigned int currentNum = startNum;
char input;

printf("Incremental Dialer - Press 's' to start, 'p' to pause, 'q' to quit.\n");

while (state != STATE_EXIT) {
if (_kbhit()) { // Check if a key has been pressed
input = getch(); // Get the key press without echoing

switch (input) {
case 's': // Start or resume dialing
if (state == STATE_IDLE || state == STATE_PAUSED) {
state = STATE_DIALING;
printf("Dialing started...\n");
}
break;
case 'p': // Pause dialing
if (state == STATE_DIALING) {
state = STATE_PAUSED;
printf("Dialing paused. Press 's' to resume.\n");
}
break;
case 'q': // Quit the program
state = STATE_EXIT;
printf("Exiting...\n");
break;
default:
printf("Invalid input. Use 's', 'p', or 'q'.\n");
}
}

switch (state) {
case STATE_DIALING:
if (currentNum <= endNum) {
printf("Dialing: %u\n", currentNum++);
delay_ms(100); // Simulate dialing delay (100ms per number)
} else {
printf("Reached the end of the range. Returning to idle.\n");
state = STATE_IDLE;
}
break;

case STATE_IDLE:
// Waiting for user input to start
break;

case STATE_PAUSED:
// Do nothing, just waiting for user input to resume
break;

case STATE_EXIT:
// Exit condition handled in the outer loop
break;
}
}

printf("Program terminated. Goodbye!\n");
return 0;
}

Explanation​

  1. State Machine Design:
    • The state machine is implemented using two switch statements:
      • The first checks user input to change the state.
      • The second executes the behavior based on the current state.
  2. States:
    • STATE_IDLE: The dialer waits for the user to press 's' to start.
    • STATE_DIALING: The program prints the current number and increments it.
    • STATE_PAUSED: The dialer pauses until the user presses 's' to resume.
    • STATE_EXIT: The program exits when 'q' is pressed.
  3. DOS Specifics:
    • _kbhit() and getch() detect key presses without waiting for Enter.
    • delay() (from <dos.h>) is used to simulate the dialing delay.
  4. Usage:
    • Start the program, press 's' to start dialing, 'p' to pause, and 'q' to quit.

This should run smoothly on Microsoft QuickC for DOS and give you that nostalgic WarGames dialing feel! Let me know if you'd like any changes or additional features.
 
  • Dumb
Reactions: N Space
chatgpt, can you write a program that is written using microsoft quickc for dos that is a basic incremental dialer similar to that which was in the war games movie and can you design it as a state machine using the switch statement?
You've got your own though? Also... Why in QUICKC lol are you gonna run and compile it on DOS
 
ChatGPTs comments are so horrible aswell, why'd they have to train it on comment on every line content.

Edit It's actually totally non functional isn't it? The PAUSE and IDLE don't even do anything except skip to the next instruction. You could just if or while the one condition that does anything lol
 
Last edited:
Caesar and oxygen are social and intellectual predators.

They stalk me and bully me, hoping that I will eventually give up some clues about my algorithm.

They are bottom feeders.

They are parasites.

Screenshot_20241016-144308.pngScreenshot_20241016-144315.png
 
  • Lunacy
Reactions: Free Dick Pills
You've got your own though? Also... Why in QUICKC lol are you gonna run and compile it on DOS

Many people fail to recognize that a c program that runs on dos will run faster than greased lightning.

Dos doesn't have the operating system overhead that a windows-based system would typically have.

That's one reason I appreciate pic style chips because they just simply don't have an underlying operating system to bog things down.

As a programmer I like to be as close to the metal as I can possibly be.

--------

Back in the 90s I used Microsoft quick C to automate the dialing functions of an eight station outbound manual telemarketing room by putting 16 Telco lines and eight telephones into a 286 PC and I process the status of all 16 lines and eight telephones more than 900 times per second.

That is why I use C.
 
Many people fail to recognize that a c program that runs on dos will run faster than greased lightning.

Dos doesn't have the operating system overhead that a windows-based system would typically have.

That's one reason I appreciate pic style chips because they just simply don't have an underlying operating system to bog things down.

As a programmer I like to be as close to the metal as I can possibly be.
...but why QuickC and not like, Borland? And just don't use Windows. You could use a stripped down Linux that's gonna have way more modern optimisations and networking which would be important in this project, or an RTOS if you really need nanosecond precision.

The code doesn't even do anything except generate a random number and print it lol
 
  • Optimistic
Reactions: Free Dick Pills
...but why QuickC and not like, Borland? And just don't use Windows. You could use a stripped down Linux that's gonna have way more modern optimisations and networking which would be important in this project, or an RTOS if you really need nanosecond precision.

The code doesn't even do anything except generate a random number and print it lol

I have also used the Borland turbo C for dos extensively, but my hands down preference is quickC.

You are wasting your time debating me about my hardware and software choices.

I know what I like and that is what I'm going to do and use.

I don't care what you think about those choices.
 
Last edited:
You're right, there was already such lively and in-depth discussion here.

There is not going to be any lively and in-depth discussion going on here.

There is me talking about trading using a martingale method.

You are a fucking baby.

Stop whining or leave the room.

This isn't the let's listen to Caesar's opinion about everything that Edward does thread.

Screenshot_20241016-151825.png
 
There is me talking about trading using a martingale method.
You're not actually talking about anything though, that's why the replies dried up. It's just weird rants, repitition and contextless screenshots without comment.

This isn't the let's listen to Caesar's opinion about everything that Edward does thread.
Unfortunately

You are a fucking baby.

Stop whining or leave the room.
Pot, meet kettle.
 
Can someone smarter than me tell me if these screenshots he's sharing show anything meaningful at all, let alone what he purports them to show? I confess to being mostly innumerate and illiterate, but the impression I get looking at these is the same impression I get seeing schizophrenics string words into sentences. It just looks like random numbers on a screen to me.
Probably late to the party (can't bother reading all pages of this) but the screenshot shows a risk management strategy coded in MQL, with projected profit targets and margin required to maintain those positions, So yeah it's meaningful but whether or not its profitable is another matter entirely. Martingale is a risk management strategy, not a trading strategy, and I assume tradecode has some algorithm when to enter or exit because martingale is just icing on the cake, not the cake itself.
 
Probably late to the party (can't bother reading all pages of this) but the screenshot shows a risk management strategy coded in MQL, with projected profit targets and margin required to maintain those positions, So yeah it's meaningful but whether or not its profitable is another matter entirely. Martingale is a risk management strategy, not a trading strategy, and I assume tradecode has some algorithm when to enter or exit because martingale is just icing on the cake, not the cake itself.

I have to agree with everything you said.

I began writing C language in 1991, so when i began using and programming metatrader in 2005 when it was first released, i already had approx 14 years of C under my belt.

A good resource to get your feet wet with metatrader:


 
Last edited by a moderator:
Back