Replies

the.innovative214
25 Sep 2023, 16:32

Not really am expert. I'm new to this myself but I learned due to the asynchronous nature of the connection, it doesn't seem to like typical loops… I have used recursion instead such as if I had a list of forex pairs for example I would pop off the first one in the list, do whatever work I wanted on it and then call the original definition again until I had popped off all the forex_pairs and then once the list is empty I stop the reactor. Example…

def define forex_pairs

    forex_pairs = [some list here]

     process_forex_pairs()

def Process_forex_pairs

     forex_pair = next popped off from the list of forex_pairs

     if forex_pairs not empty

            execute_trade(forex_pair)

      else

             reactor.stop

def execute_trade(forex_pair)

    do stufff here

     when finished..

    process_forex_pairs()

 

This is a pseudo idea of the  recursion I am using. Anyone else feel free to chime in and correct.

    

 


@the.innovative214

the.innovative214
21 Aug 2023, 16:35

It's ok now. Turns out I had the wrong volume size.


@the.innovative214

the.innovative214
14 Aug 2023, 20:44

RE: RE: Do I have to re-authenticate for each request?

the.innovative214 said: 

PanagiotisChar said: 

Hi there,

You only need to authenticate once. Then make sure the connection stays open by sending heartbeats.

Aieden Technologies

Need help? Join us on Telegram


 

That's great. Can you direct me into the direction on how to do that? I was thinking to have it run with a cron job on my server on certain intervals and for it to run my python script. It could be frequent so I want to avoid having to log in each time but I have not figured out how to keep the connection persistent especially if I am running a python script on certain time intervals to pull data. Again I am very new at this sort of thing.

Still looking for an answer to this if anyone has any ideas…


@the.innovative214

the.innovative214
08 Aug 2023, 15:57

RE: Do I have to re-authenticate for each request?

PanagiotisChar said: 

Hi there,

You only need to authenticate once. Then make sure the connection stays open by sending heartbeats.

Aieden Technologies

Need help? Join us on Telegram


 

That's great. Can you direct me into the direction on how to do that? I was thinking to have it run with a cron job on my server on certain intervals and for it to run my python script. It could be frequent so I want to avoid having to log in each time but I have not figured out how to keep the connection persistent especially if I am running a python script on certain time intervals to pull data. Again I am very new at this sort of thing.


@the.innovative214