Wednesday, 25 September 2024

_____________________________________________________________________________________

THE GAME



1.Start
2.Menu
3.Options














____________________________________________________________________________________ 

Monday, 23 September 2024

 Dia de hoy

IMPORTANTE:


Hola Dante.

Tienes que:


RESIDENT EVIL 5 SPLIT SCREEN. INE (SR). LICENSIA DE CONDUCIR. USA. Limpiar. bolsas de basura. limpiar arriba. LIMPIAR COMPLETO. continuar. cafe. despertar. weed. Dinero. BUSQUEDA DE TRABAJO. Status. Busqueda de trabajo rapido. Tarea. Tareas importantes. Tarea de hoy. HUMANIDADES. MATEMATICAS. ESTRUCTURAS. en ese orden. TOMORROW. ZITLAIC CUMPLE. TIA MARTA HOY. FAMILIA HOY. ANUNCIOS DE FACEBOOK IVAN SANCHEZ. Escuela. Busqueda de trabajo en San Diego. A MOTO. Clean bathroom carpets. MOSTRAR RENTA. SENTRI GLOBAL ENTRI. VENDER COSAS EN FACEBOOK HOY YA. APLICAR A TODOS LOS TRABAJOS (SR). LINKEDIN BOT APPLY.


Brainstorm A-Z list:

A.- Aplicar a 30 trabajos hoy:
-allie universal LISTO
-trabajo de programador 



Friday, 13 September 2024

 using UnityEngine;

using System.Collections;

public class gamelogicmym : MonoBehaviour

{

// Public references for the player cube (Player "P")

public GameObject playerCube;

// Public references for each enemy and NPC for each level

public GameObject enemyCapsuleA;

public GameObject npcCylinderA;

public GameObject enemyCapsuleB;

public GameObject npcCylinderB;

public GameObject enemyCapsuleC;

public GameObject npcCylinderC;

public GameObject enemyCapsuleD;

public GameObject npcCylinderD;

public GameObject enemyCapsuleE;

public GameObject npcCylinderE;

// Current level and total levels

private int currentLevel = 1;

private const int totalLevels = 5;

// Distance threshold for brute-force collision detection

public float collisionDistanceThreshold = 1.5f;

// NPC dialogue-related variables

private bool isEnemyDestroyed = false;

private bool isDialogueShown = false;

private GameObject currentNpcLabel;

private TextMesh dialogueTextMesh;

// Reference to current enemy and NPC for the current level

private GameObject currentEnemy;

private GameObject currentNPC;

// This function will be called at the start of the game

void Start()

{

// Initialize the first level

StartLevel(1);

// Attach the player label "P"

AttachDebugLetter(playerCube, "P");

Debug.Log("Starting game logic with level progression.");

}

// Update is called once per frame

void Update()

{

if (currentEnemy != null && Vector3.Distance(playerCube.transform.position, currentEnemy.transform.position) < collisionDistanceThreshold && !isEnemyDestroyed)

{

// Destroy the current enemy and show NPC

Destroy(currentEnemy);

Debug.Log($"Enemy {GetLabelForCurrentLevel()} destroyed.");

// Set NPC visible now that the enemy is destroyed

currentNPC.SetActive(true);

AttachDebugLetter(currentNPC, GetLabelForCurrentLevel());

isEnemyDestroyed = true;

}

if (isEnemyDestroyed && !isDialogueShown && Vector3.Distance(playerCube.transform.position, currentNPC.transform.position) < collisionDistanceThreshold)

{

// Show NPC dialogue

ShowNPCDialogue(GetLabelForCurrentLevel());

isDialogueShown = true;

Debug.Log($"NPC {GetLabelForCurrentLevel()} dialogue displayed.");

// Start coroutine to transition to the next level

StartCoroutine(TransitionToNextLevel());

}

}

// Function to attach a letter above the assigned object for debugging

void AttachDebugLetter(GameObject targetObject, string label)

{

// Create a new TextMesh object for the label

GameObject labelObject = new GameObject("DebugLabel");

TextMesh textMesh = labelObject.AddComponent<TextMesh>();

// Set the text to the specified label and configure appearance

textMesh.text = label;

textMesh.fontSize = 32;

textMesh.color = Color.red;

// Position the label slightly above the targetObject

labelObject.transform.position = targetObject.transform.position + new Vector3(0, 2, 0); // Adjust height here

labelObject.transform.SetParent(targetObject.transform); // Ensure the label follows the object

// Save the label for the NPC so we can add dialogue later

if (targetObject == currentNPC)

{

currentNpcLabel = labelObject;

}

}

// Function to show NPC dialogue when player collides with NPC

void ShowNPCDialogue(string label)

{

// Create a new TextMesh object for the dialogue text

GameObject dialogueObject = new GameObject("NPCDialogue");

dialogueTextMesh = dialogueObject.AddComponent<TextMesh>();

// Set the dialogue text and configure appearance

if (label == "E")

{

dialogueTextMesh.text = "Thank you for destroying the enemy";

}

else

{

dialogueTextMesh.text = $"Thank you for destroying the enemy {label}";

}

dialogueTextMesh.fontSize = 24;

dialogueTextMesh.color = Color.white;

// Position the dialogue next to the label above the NPC

dialogueObject.transform.position = currentNpcLabel.transform.position + new Vector3(1.5f, 0, 0); // Adjust position here

dialogueObject.transform.SetParent(currentNPC.transform); // Ensure the dialogue follows the NPC

}

// Coroutine to handle transition to the next level

IEnumerator TransitionToNextLevel()

{

// Wait for 10 seconds after showing dialogue

yield return new WaitForSeconds(10);

// Clear the current dialogue

if (dialogueTextMesh != null)

{

Destroy(dialogueTextMesh.gameObject);

}

// Increment to the next level, or finish the game if the final level is completed

if (currentLevel < totalLevels)

{

currentLevel++;

StartLevel(currentLevel);

isEnemyDestroyed = false;

isDialogueShown = false;

}

else

{

Debug.Log("All levels complete. Game finished.");

}

}

// Function to start a specific level

void StartLevel(int level)

{

Debug.Log($"Starting Level {level}");

// Activate the appropriate enemy and NPC for the given level

switch (level)

{

case 1:

currentEnemy = enemyCapsuleA;

currentNPC = npcCylinderA;

break;

case 2:

currentEnemy = enemyCapsuleB;

currentNPC = npcCylinderB;

break;

case 3:

currentEnemy = enemyCapsuleC;

currentNPC = npcCylinderC;

break;

case 4:

currentEnemy = enemyCapsuleD;

currentNPC = npcCylinderD;

break;

case 5:

currentEnemy = enemyCapsuleE;

currentNPC = npcCylinderE;

break;

}

// Make sure to deactivate NPC at the start of each level

currentNPC.SetActive(false);

// Activate the current enemy for the level

currentEnemy.SetActive(true);

AttachDebugLetter(currentEnemy, GetLabelForCurrentLevel());

}

// Function to get the label for the current level (A, B, C, D, or E)

string GetLabelForCurrentLevel()

{

switch (currentLevel)

{

case 1: return "A";

case 2: return "B";

case 3: return "C";

case 4: return "D";

case 5: return "E";

default: return "";

}

}

}

____________________________________

lets evolve this script. to add more game play.

lets add health and damage components,

To both the player and the enemies.

Pseudo Code Example:

Player 200 health

All Enemy 100 health

Player damage to Enemy of -1

Enemy recevies damage by player -1

Player recevies damage by enemy -1

Player P, Enemies ABCDE

Enemy will get destroyed if reaches 0 from 100. (on -1 player collision) -1/100.

If player collides with enemy player also recives -1 of damage

Player Health 200. player reaches 0. Player health will restart to 200 jsut for debug.

If enemy reaches 0 will dissapear.

Use the bruite force collision for this. and use the red annotation to show the enemy damage.

Player makes damage to the enemy (-1) every collisison and a "1" number appears as a floating annotation similar to the ones that alredy exist. P ABCDE and 1 every collision. 

Thursday, 12 September 2024

 FINAL NOTE GAMELOGIC


THE GAME / NEW PLANET / TIJUANA

START GAME /

game logic script. 


Game connection to pause & start menu.

5 levels. A, B, C, D, E

Pause Menu.


CHECK POINT. (master)

 Save Menu. Load check point.

 On game. on menu.on start menu.


Player Stats. Player Health 100.



LEVEL A1

Respective enmies: 7 enemies 

Respective NPC: Player kills all 7enemies.
NPC appears ( after Player kills all enemies )

Player colission & Damage / kill progress.
Enemies health 100.
Player damage to enemies  -1 (on collision regular)
Player gets damae from enemies  -1 (on collision regular)

Cinematic black screen debug 10 secs. Start mp4.






LEVEL B2

Respective enmies: 10 enemies
Respective NPC:  Player kills all 10 enemies. Boss B2. Player kills the boss
NPC appears ( after Player kills all enemies & Bosss  )

Player colission & Damage / kill progress.
Enemies health 100.
Player damage to enemies  -1 (on collision regular)
Player gets damae from enemies  -1 (on collision regular)

Cinematic black screen debug 10 secs. Start mp4.





LEVEL C3

Respective enmies: 20 enemies (beta 2 rounds 10. -> 10.)
Respective NPC:  Player kills all 20 enemies. Boss C3. Player kills the boss
NPC appears ( after Player kills all enemies & Bosss )

Player colission & Damage / kill progress.
Enemies health 100.
Player damage to enemies  -1 (on collision regular)
Player gets damae from enemies  -1 (on collision regular)

Cinematic black screen debug 10 secs. 




LEVEL D4

Respective enmies: 20 enemies (beta 2 rounds 10. -> 10.)
Respective NPC:  Player kills all 20 enemies. Boss D4. Player kills the boss
NPC appears ( after Player kills all enemies & Bosss  )

Player colission & Damage / kill progress.
Enemies health 100.
Player damage to enemies  -1 (on collision regular)
Player gets damae from enemies  -1 (on collision regular)

Cinematic black screen debug 10 secs. 



LEVEL  E5

Respective enmies: 20 enemies (beta 2 rounds 10. -> 10.)
Respective NPC:  Player kills all 20 enemies. Boss E5. Player kills the boss
NPC appears ( after Player kills all enemies & Bosss )

Player colission & Damage / kill progress.
Enemies health 100.
Player damage to enemies  -1 (on collision regular)
Player gets damae from enemies  -1 (on collision regular)

Cinematic black screen debug 10 secs. 









Wednesday, 4 September 2024

    python c:/Users/ds1020254/Desktop/dante.py    python c:/Users/ds1020254/Desktop/demente.py   python c:/Users/ds1020254/Desktop/THE.py C:\Users\ds1020254\Desktop 312128713 Sexo247420@ XMGlobal-MT5 7


 ----------------------หนีออกจากคุก----------------------


V1

BACK FIRE (START)

3DAYS IN A ISOLATED HOTEL (H)




 PROTOCOLO DRUG FREE. (SR FINAL 1/10)
DANTE SANCHEZ






POR QUE?

- RUSSIAN FOREST BEACH (the only dream)





notas1: 


Clinica de San Diego. Cambiar la Clinica de San Diego por una clinica mas al Norte.




notas2:

Calendario:

INTOXICATED to DETOXICATED 

date start and end.


notas3: 


Handle withdrawal

-Hobbie free
-Studio free
-Economics free
-College free


Dante is beginning a detox process at a clinic. He needs to complete a psychological questionnaire, undergo certification, and use his social security. He will attend talks to help manage his marijuana addiction but also has to make a personal commitment to quit. The process involves following the guidance of his psychiatrist, doctor, and psychologist, while meeting all detoxification requirements.


The hardest part of quitting is overcoming the addiction. True freedom comes from being free of external substances. Dante has tried other methods without success and now needs to follow the clinical protocol, attending rehabilitation talks and undergoing medical assessments. He acknowledges the mental control and addiction that have kept him from quitting despite wanting to do so every day.


This journey is about escaping addiction and embracing sobriety. The medical procedure is essential to address the problem and reclaim productive time. Sobriety will help Dante understand how to live a functional, addiction-free life.


The first step is getting his marijuana addiction documented and starting the detox process.n dans le cas ou un certain ecart serait atteint avant l'epoque


Cuales son las cosas que mas te ayudan a mantenerte sobrio:

Here is the refined list, removing activities that could be harmful or counterproductive:


Safe Distractions:

- Dibujo

- Programación

- Arquitectura

- Surf

- Natación

- Diseño

- Carpintería

- Boxeo

- Leer libros

- Comer bien

- Ser vegetariano

- Meditación

- Machine learning



Removed (Potentially Harmful or Counterproductive):

- Mujeres (if it involves unhealthy or obsessive behavior)

- Plantar marihuana (!VENGANZA)

- Dinero (if it becomes an obsession or leads to unhealthy stress)

- Japón, China (if these are escapist fantasies rather than productive interests)

- NOT THE USA, NOT MEXICO, NO RICHY, NO 2024 XSW (these seem to be negative or limiting beliefs)

- Breatharian (dangerous practice)

- Millonario (if it fuels unhealthy obsession with wealth)

- Hijos, Esposa (could be distractions if pursued for the wrong reasons)

- Barco (similar to escapism)

- Social media attacks, Robot attacks, Robot venganza (negative or destructive behavior)


This streamlined list focuses on positive and productive activities that can support your goal of quitting and staying focused.









__________________________________________________

you are sober now manage the backfire.








 ----------------------หนีออกจากคุก----------------------



Sunday, 1 September 2024

 MYM-A          BLANCO


COPIAR. pinescript Trading View.
DELETE DADO 3


USAR "MODO CEREZA" COMO REFERENCIA


Simple.


mym-a 


LSTM.

MT5 LST TRAINING HISTORY

NON MT5 PLOT.

PLOT. chart in candlesticks. black and white. simple visual in 900 by 900.

chart: from june 1 to july 1. in candlesticks.

Target in Chart: multiple entries and exists with profit of 0.1 / sell or buy depending on LSTM


LSTM modelo file. -----> LSTM -REAL TIME ------->ANOTHER


FILE DECISION : EXECUTION 


FLD-> delay and execution 

CHART BACKTEST = VISUAL EXECUTION SIMULATION PLOT

______________________________

BACK TEST MODEL






________________________________________________________________________________




import MetaTrader5 as mt5

import pandas as pd

import numpy as np

import matplotlib.pyplot as plt

from sklearn.preprocessing import MinMaxScaler

from tensorflow.keras.models import Sequential

from tensorflow.keras.layers import LSTM, Dense

import tkinter as tk

from datetime import timedelta


def main():

    # Initialize and connect to MT5 to fetch historical data

    if not mt5.initialize():

        raise Exception("MetaTrader5 initialization failed")

    

    login = 312128713

    password = "Sexo247420@"

    server = "XMGlobal-MT5 7"

    

    if mt5.login(login=login, password=password, server=server):

        print("Connected to MetaTrader 5 for data retrieval")

        perform_backtest()

    else:

        raise Exception("Failed to connect to MetaTrader 5")


def perform_backtest():

    # Fetch data, train the model, and run backtest

    symbol = "BTCUSD"

    timeframe = mt5.TIMEFRAME_H4  # 4-hour time frame for the simulation

    days = 600

    data = fetch_historical_data(symbol, timeframe, days)

    scaled_data, scaler = preprocess_data(data)

    model = train_lstm_model(scaled_data)

    future_hours = 24 * 30 / 4  # Simulating a month with 4-hour intervals

    predicted_prices = predict_future(model, scaled_data, int(future_hours))

    predicted_prices = scaler.inverse_transform(np.array(predicted_prices).reshape(-1, 1))

    

    # Backtest with simulated trades and plot the results

    backtest_and_plot(data, predicted_prices)


def fetch_historical_data(symbol, timeframe, days):

    rates = mt5.copy_rates_from_pos(symbol, timeframe, 0, days)

    if rates is None or len(rates) == 0:

        raise Exception("Failed to retrieve rates")

    df = pd.DataFrame(rates)

    df['time'] = pd.to_datetime(df['time'], unit='s')

    return df[['time', 'close', 'open', 'high', 'low']]


def preprocess_data(data):

    scaler = MinMaxScaler(feature_range=(0, 1))

    scaled_data = scaler.fit_transform(data['close'].values.reshape(-1, 1))

    return scaled_data, scaler


def train_lstm_model(scaled_data):

    time_step = 60

    X_train, y_train = create_train_data(scaled_data, time_step)


    model = Sequential()

    model.add(LSTM(100, return_sequences=True, input_shape=(X_train.shape[1], 1)))

    model.add(LSTM(100, return_sequences=False))

    model.add(Dense(50))

    model.add(Dense(1))

    model.compile(optimizer='adam', loss='mean_squared_error')


    model.fit(X_train, y_train, batch_size=32, epochs=50)

    return model


def create_train_data(scaled_data, time_step):

    X_train, y_train = [], []

    for i in range(time_step, len(scaled_data)):

        X_train.append(scaled_data[i-time_step:i, 0])

        y_train.append(scaled_data[i, 0])

    X_train, y_train = np.array(X_train), np.array(y_train)

    X_train = np.reshape(X_train, (X_train.shape[0], X_train.shape[1], 1))

    return X_train, y_train


def predict_future(model, data, future_hours):

    predictions = []

    time_step = 60

    input_seq = data[-time_step:]


    for _ in range(future_hours):

        input_seq = input_seq.reshape((1, input_seq.shape[0], 1))

        predicted_price = model.predict(input_seq)[0]

        predictions.append(predicted_price)

        input_seq = np.append(input_seq[:, 1:], predicted_price)

    return predictions


def backtest_and_plot(data, predicted_prices):

    initial_balance = 10000

    balance = initial_balance

    lot_size = 0.1

    trade_log = []


    # Filter the data for the period of June 1, 2024, to July 1, 2024

    data_subset = data[(data['time'] >= '2024-06-01') & (data['time'] <= '2024-07-01')].copy()


    open_trade = None  # To keep track of the currently open trade

    for i in range(1, len(data_subset) - 1):

        if i >= len(predicted_prices):

            break  # Exit if we run out of predictions


        if open_trade is None:

            if predicted_prices[i] > predicted_prices[i-1]:

                # Open a buy trade

                entry_price = data_subset['close'].iloc[i]

                open_trade = {'time': data_subset['time'].iloc[i], 'type': 'Buy', 'entry_price': entry_price}

            elif predicted_prices[i] < predicted_prices[i-1]:

                # Open a sell trade

                entry_price = data_subset['close'].iloc[i]

                open_trade = {'time': data_subset['time'].iloc[i], 'type': 'Sell', 'entry_price': entry_price}


        if open_trade is not None:

            if open_trade['type'] == 'Buy':

                # Check if we can close the buy trade profitably

                current_price = data_subset['close'].iloc[i+1]

                if current_price > open_trade['entry_price'] + 0.1 / lot_size:

                    trade_log.append({**open_trade, 'exit_price': current_price, 'exit_time': data_subset['time'].iloc[i+1]})

                    balance += lot_size * (current_price - open_trade['entry_price']) * 100000

                    open_trade = None

            elif open_trade['type'] == 'Sell':

                # Check if we can close the sell trade profitably

                current_price = data_subset['close'].iloc[i+1]

                if current_price < open_trade['entry_price'] - 0.1 / lot_size:

                    trade_log.append({**open_trade, 'exit_price': current_price, 'exit_time': data_subset['time'].iloc[i+1]})

                    balance += lot_size * (open_trade['entry_price'] - current_price) * 100000

                    open_trade = None


    # Plotting the results

    plt.figure(figsize=(9, 9))

    plt.plot(data_subset['time'], data_subset['close'], color='black', label='Close Price')


    # Plot trades on the chart

    for trade in trade_log:

        entry_color = 'green' if trade['type'] == 'Buy' else 'red'

        exit_color = 'blue'

        plt.scatter(trade['time'], trade['entry_price'], color=entry_color, label=f"{trade['type']} Entry")

        plt.scatter(trade['exit_time'], trade['exit_price'], color=exit_color, label=f"{trade['type']} Exit 0.1")

        plt.annotate(f"exit 0.1", (trade['exit_time'], trade['exit_price']), textcoords="offset points", xytext=(0,10), ha='center')


    plt.legend()

    plt.xlabel('Date')

    plt.ylabel('Price')

    plt.title(f'BTCUSD Price Prediction with LSTM (Balance: {balance:.2f})')

    plt.show()


def show_ui():

    root = tk.Tk()

    root.title("LSTM Backtesting Visualization")

    root.geometry("300x200")


    start_button = tk.Button(root, text="Start Backtest", command=main, font=("Helvetica", 14))

    start_button.pack(pady=50)


    root.mainloop()


if __name__ == "__main__":

    show_ui()




















https://youtu.be/jZ38C-M3tyk?si=ERjuJ8hqsQwV2vAp