i've abilitate autotrading in AA mode and i'm connect to brokermp=marketposition;
if mp<>mp[1] and mp<>0 then begin
print(date,time," ",entryprice," ",avgEntryPrice_at_Broker);
end;
1240626.00 900.00 5522.50 0.00
1240626.001115.00 5539.75 0.00
1240627.001330.00 5535.00 0.00
1240627.001415.00 5537.25 0.00
1240717.00 900.00 5661.75 0.00
1240722.001000.00 5607.00 0.00
1240726.00 945.00 5491.75 0.00
i see entryprice but i don't see avgEntryPrice_at_Broker
how to get price at broker?
hi, i code this
- Attachments
-
- Immagine_2.png
- (29.82 KiB) Not downloaded yet
I think you are too fast with obtaining the price from the Broker; you should or synchronize first, or wait for x milliseconds until the order has been processed by the broker and all.
Querying MarketPositionAtBroker also does wonders. Thus if that is still 0 then there is no Price yet either.
Regards,
Peter
Querying MarketPositionAtBroker also does wonders. Thus if that is still 0 then there is no Price yet either.
Regards,
Peter
ok if i want to get price in realtime i use MarketPositionAtBroker
but if i want to get price filled in position tracker (see pics)
how can i do?
The prices are already present and I want to print these at the end of the session
but if i want to get price filled in position tracker (see pics)
how can i do?
The prices are already present and I want to print these at the end of the session
- Attachments
-
- Immagine.png
- (15.33 KiB) Not downloaded yet
I think I understand, but still this is a bit vague to me. I think that your "problem" merely is to print them at all, which is a matter of doing it the correct way;I want to print these at the end of the session
I am not of the type who asks "why do you want to use AA in the first place ?" but it is about that. So this is your choice - now behave accordingly. In my experience this is not easy at all.
So really, start out with being able to print them as per your first post and when that works go to the next step.
My idea : Literally Print them/it might not be the way to go. Obtain it in some log file could be the better thought;
Here I must pass for the general MC version, but for the .Net version I myself would face some challenges just the same (just no experience with it). Initialize a new Log File Name per session (per Backtest "session" / per Live session) comes to mind. Decently add to it, while knowing you can't close it at each new record added (too much time consuming ?). Thus no FileStreamWriter (.Net) but something which appends all the time. People in here will know ...
Why do this in AA mode ? (just interested)