Python obj return in amipy

Hi,
Im using python-Amipy to place the order and all signal generation is from AFL. To place an order first i need to login and create a python-broker-objectand use it place the order.

I was thinking of creating an object begining of the session and use it thoughout the session, but i see that python-object return is not supported. Is there any alternative way to implement this. Otherwise i need to login everytime right before i place the order.

thanks

image

You did not provide formula/code. Please follow this advice: How to ask a good question

Im not sure why this question requires the Formula code, this is pretty generic.
is the AFL-amipy supports python-object return from the python function?

AFL code:

PyLoadFromFile("example1", "C:\\Program Files.....\\test.py");
user_id = "e6-26c1-4fea-9ea2-c6e33bfcb209";
diff = PyEvalFunction("example1", "test", user_id );

python code :

def test(user_id) :
    broker_obj = AutoTrader.create_instance(user_id, AutoTrader.SERVER_URL) 
    return broker_obj

thanks

Yes code is needed to know what you did. We don't have magic mirrors.

Did you read the docs?

Where in the docs did you find that you can return Python objects????

You can't. Read the docs. It is written in the docs what types you can return. If something is NOT in the docs it is NOT available.

AmiBroker is NOT PYTHON. Why you expect PYTHON objects to be assignable to AFL variable (that is NOT PYTHON based) is beyond any reasonable person understanding.

So again: read the docs. If something is NOT in the docs, it does NOT exist.

This topic was automatically closed 100 days after the last reply. New replies are no longer allowed.