Gamestudio Links
Zorro Links
Newest Posts
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
M1 Oversampling
by 11honza11. 04/30/24 08:16
Trading Journey
by howardR. 04/28/24 09:55
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
Why Zorro supports up to 72 cores?
by jcl. 04/26/24 11:09
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
4 registered members (AndrewAMD, SBGuy, TipmyPip, ozgur), 923 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 2 of 3 1 2 3
Re: Xor Memory Problem. [Re: TipmyPip] #487946
11/28/23 11:07
11/28/23 11:07
Joined: Feb 2017
Posts: 1,725
Chicago
AndrewAMD Online
Serious User
AndrewAMD  Online
Serious User

Joined: Feb 2017
Posts: 1,725
Chicago
I'm not new to Lite C. And you missed this from the manual:
Quote
!! Unlike C/C++, sizeof(some struct) requires that at least one instance of the struct exists. Otherwise sizeof will return 0.
!! Arrays are internally treated as a pointer to a memory area. So, sizeof(some array) and sizeof(some pointer) always evaluates to 4 because that is the size of a pointer.
https://zorro-project.com/manual/en/structs.htm

You throw standard code at a nonstandard language and expect standard behavior? It won't always work.

Re: Xor Memory Problem. [Re: AndrewAMD] #487947
11/28/23 11:30
11/28/23 11:30
Joined: Sep 2017
Posts: 82
T
TipmyPip Online OP
Junior Member
TipmyPip  Online OP
Junior Member
T

Joined: Sep 2017
Posts: 82
Dear Andrew, Please consider, that I have already read the manual, I have requested from anyone who has more experience in programming, more abstract ideas, and a more creative mind,
to try to solve the problem, not refer me to the manual, which I have already done, and I have already written the code in lite-C, but I wish not to share my ideas,
I want to find the creative one, who is blessed with much more money to contribute his knowledge and time, that way, we can exchange ideas more with clear minds instead of competing on
poetic notions of unrealistic imagination.

But I guess I already asked you if you know what the code above performs...


ZorroTraderGPT - https://bit.ly/3Gbsm4S
Re: Xor Memory Problem. [Re: TipmyPip] #487948
11/28/23 14:03
11/28/23 14:03
Joined: Feb 2017
Posts: 1,725
Chicago
AndrewAMD Online
Serious User
AndrewAMD  Online
Serious User

Joined: Feb 2017
Posts: 1,725
Chicago
I'm satisfied with the effort I put into this problem, but only because I'm not interested in solving it myself. If you really must have someone fix your code, you can always pay someone to do it for you.

Re: Xor Memory Problem. [Re: TipmyPip] #487949
11/28/23 14:23
11/28/23 14:23
Joined: Sep 2017
Posts: 82
T
TipmyPip Online OP
Junior Member
TipmyPip  Online OP
Junior Member
T

Joined: Sep 2017
Posts: 82
I do understand, And I respect the wisdom of your choices, But if you can describe your solution with half a sentence, how come you can't show me what is the meaning of: "putting a dummy struct variable upstream of your size of calls"
it seems that sentence is describing initializing a struct with whatever you have difficulty describing in code because most likely you don't want to try to solve a problem which you don't have a solution for, let alone the money you don't have time for.

But you do have the time to prove your wisdom with no intentions by describing partial solutions that don't exist.

Our Future interactions might be beyond the wisdom of your current limitations, where I suppose you can't imagine other ways to make money.
If you think I need to pay for a limitation that lite-C can't resolve.

(The fact you stated: "but only because I'm not interested in solving it myself," proves your so-called suggestion doesn't have any logical basis, because you have already stated that you are not interested in solving it for yourself, meaning you don't have a clue of how to solve it, which also means you share your suggestions only to get some emotional credit for showing of your unlogical description of whatever you can't imagine with "putting a dummy struct variable upstream of your size of calls" in relation to the code I have written, This also proves that giving sarcastic supervision, doesn't make you a professional programmer, Sir.)

Last edited by TipmyPip; 11/28/23 15:03.

ZorroTraderGPT - https://bit.ly/3Gbsm4S
Re: Xor Memory Problem. [Re: TipmyPip] #487981
12/13/23 10:55
12/13/23 10:55
Joined: Sep 2017
Posts: 82
T
TipmyPip Online OP
Junior Member
TipmyPip  Online OP
Junior Member
T

Joined: Sep 2017
Posts: 82
Here is an Abstract Strategy Example for those who can find the relation between the above C program and Financial Properties in relation to conditional attributes under certain market imbalances which can be mathematically calculated with logic gates
But, in order to solve the problem faster, and statistically find the most beneficial probabilities you will need to use advanced engineering ideas with Zorro Trader GPT.

Code
#include <litec.h>
#include <trade.h>

#define INT_BITS 32
#define MAX_NODES 1024
#define DATA_SIZE 20

// Trie node structure
typedef struct TrieNode {
    struct TrieNode* bit[2];
} TrieNode;

TrieNode trieNodes[MAX_NODES];
int trieNodeCount = 0;

// Function prototypes
TrieNode* newTrieNode();
void insert(TrieNode* root, int number);
int findMaxXOR(TrieNode* root, int number);
int getMaxXOR(int* arr, int size);
var calculateMaximumXOR(var spreadData[]);
string generateTradingSignal(var maxXOR, var threshold);

void run() 
{
    BarPeriod = 60; // Set your bar period
    LookBack = 100; // Set your lookback period
    
    while(asset(loop("Asset1", "Asset2"))) {
        var spreadData[DATA_SIZE]; // Array to hold spread data
        // Populate spreadData with your financial data logic
        // Example: spreadData[i] = priceClose(i) - priceClose(i+1) for some i

        var threshold = 0.02;
        var maxXOR = calculateMaximumXOR(spreadData);
        string signal = generateTradingSignal(maxXOR, threshold);

        if (!strcmp(signal, "Buy")) {
            enterLong();
        } else if (!strcmp(signal, "Sell")) {
            enterShort();
        }
        // "No Action" case is implicitly handled by doing nothing
    }
}

var calculateMaximumXOR(var spreadData[]) 
{
    int intSpreadData[DATA_SIZE];
    for(int i = 0; i < DATA_SIZE; i++) {
        intSpreadData[i] = (int)(spreadData[i] * 10000); // Scale and convert to int
    }
    return getMaxXOR(intSpreadData, DATA_SIZE);
}

string generateTradingSignal(var maxXOR, var threshold) 
{
    if (maxXOR > threshold) {
        return "Buy";
    } else if (maxXOR < -threshold) {
        return "Sell";
    } else {
        return "No Action";
    }
}

TrieNode* newTrieNode() { /* ... */ }
void insert(TrieNode* root, int number) { /* ... */ }
int findMaxXOR(TrieNode* root, int number) { /* ... */ }
int getMaxXOR(int* arr, int size) { /* ... */ }


ZorroTraderGPT - https://bit.ly/3Gbsm4S
Re: Xor Memory Problem. [Re: TipmyPip] #487989
12/15/23 16:25
12/15/23 16:25
Joined: Sep 2017
Posts: 82
T
TipmyPip Online OP
Junior Member
TipmyPip  Online OP
Junior Member
T

Joined: Sep 2017
Posts: 82
Here is another strategy to help those who find the relation between the abstract currency moves in different timeframes and their relation to other currency moves.
If anyone has great ideas to share, I am quite sure money is already flowing in your world of creation and inspired beyond this physical world of desire.

Code
// Function prototypes
void ConvertToBinary(vars priceData, int* binaryRepresentation, int length);
void XORBinaryLists(int* list1, int* list2, int* result, int length);
int FindMaximumXOR(int* xorResult, int length);

void run() 
{
    // Set parameters
    BarPeriod = 60; // 1-hour bars
    StartDate = 2020;
    EndDate = 2021;
    LookBack = 100; // Look back period for initialization

    // Define the list of currency pairs
    string pairs[] = {"EURUSD", "GBPUSD", "USDJPY", "GBPJPY", "USDCAD", "EURAUD", "EURJPY", "AUDCAD",
               "AUDJPY", "AUDNZD", "AUDUSD", "CADJPY", "EURCAD", "EURCHF", "EURGBP", "EURNZD", 
               "GBPCAD", "GBPCHF", "NZDCAD", "NZDJPY", "NZDUSD", "USDCHF", "CHFJPY", "AUDCHF", 
               "GBPNZD", "NZDCHF", "CADCHF", "GBPAUD"
    int numPairs = sizeof(pairs) / sizeof(string);

    // Loop through each currency pair
    for(int i = 0; i < numPairs; i++) 
    {
        asset(pairs[i]);
        vars ClosePrices = series(priceClose());

        // Prepare binary representations for XOR operation
        int length = LookBack;
        int binaryPriceX[length];
        int binaryPriceY[length];

        // Fill binary representations (example: comparing current prices with a moving average)
        ConvertToBinary(ClosePrices, binaryPriceX, length);
        ConvertToBinary(series(SMA(ClosePrices, 20)), binaryPriceY, length); // 20-period SMA for comparison

        // Perform XOR operation
        int xorResult[length];
        XORBinaryLists(binaryPriceX, binaryPriceY, xorResult, length);

        // Find Maximum XOR value
        int max_xor = FindMaximumXOR(xorResult, length);

        // Example trading logic based on Maximum XOR
        if(max_xor == 1) // Significant divergence detected
            enterLong();
        else
            exitLong();
    }
}

void ConvertToBinary(vars priceData, int* binaryRepresentation, int length) 
{
    int i;
    for(i = 0; i < length; i++) 
    {
        binaryRepresentation[i] = (priceData[i] > priceData[0]) ? 1 : 0;
    }
}

void XORBinaryLists(int* list1, int* list2, int* result, int length) 
{
    int i;
    for(i = 0; i < length; i++) 
    {
        result[i] = list1[i] ^ list2[i];
    }
}

int FindMaximumXOR(int* xorResult, int length) 
{
    int max_xor = 0;
    for(int i = 0; i < length; i++) 
    {
        if(xorResult[i] > max_xor) 
            max_xor = xorResult[i];
    }
    return max_xor;
}


Thank you to the Team of Zorro Trader, who have inspired my life.

Last edited by TipmyPip; 12/15/23 16:29.

ZorroTraderGPT - https://bit.ly/3Gbsm4S
Re: Xor Memory Problem. [Re: TipmyPip] #488002
12/24/23 17:32
12/24/23 17:32
Joined: Mar 2021
Posts: 35
Ocean county, Florida
NewtraderX Offline
Newbie
NewtraderX  Offline
Newbie

Joined: Mar 2021
Posts: 35
Ocean county, Florida
So , did you get the answer you were looking for? did you get it from gpt?

Re: Xor Memory Problem. [Re: TipmyPip] #488003
12/24/23 17:52
12/24/23 17:52
Joined: Mar 2021
Posts: 35
Ocean county, Florida
NewtraderX Offline
Newbie
NewtraderX  Offline
Newbie

Joined: Mar 2021
Posts: 35
Ocean county, Florida
where are the definition for these binaryPriceX and binaryPriceY

int binaryPriceX[length];
int binaryPriceY[length];

Re: Xor Memory Problem. [Re: TipmyPip] #488004
12/24/23 23:12
12/24/23 23:12
Joined: Mar 2021
Posts: 35
Ocean county, Florida
NewtraderX Offline
Newbie
NewtraderX  Offline
Newbie

Joined: Mar 2021
Posts: 35
Ocean county, Florida
Originally Posted by TipmyPip
Here is another strategy to help those who find the relation between the abstract currency moves in different timeframes and their relation to other currency moves.
If anyone has great ideas to share, I am quite sure money is already flowing in your world of creation and inspired beyond this physical world of desire.
...........................................
Thank you to the Team of Zorro Trader, who have inspired my life.


Another question,
have you tried your gpt to solve this issue with your script?

Re: Xor Memory Problem. [Re: NewtraderX] #488009
12/26/23 15:58
12/26/23 15:58
Joined: Sep 2017
Posts: 82
T
TipmyPip Online OP
Junior Member
TipmyPip  Online OP
Junior Member
T

Joined: Sep 2017
Posts: 82
Which one of the scripts? There are more to come, BTW... You try using Zorro Trader GPT, improve the script, and share the ideas with all of us, like I am...

There are several paths to proceed with the development...

1. HFT - tick Trading with Hilbert Transforms
2. LFT - currency strength
3. and a Combination of the above.


ZorroTraderGPT - https://bit.ly/3Gbsm4S
Page 2 of 3 1 2 3

Moderated by  Petra 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1