doubt with currentshares

Questions about MultiCharts and user contributed studies.
waldem
Posts: 115
Joined: 18 Nov 2013
Has thanked: 3 times
Been thanked: 4 times

doubt with currentshares

Postby waldem » 28 Apr 2016

hi team, i still have little doubt with currentshares.

if i use "sinc" mode and i got partial order fill (for eg. fill 5 instead of 10), currentshares should be 5 correct? therefore in this case is same of marketposition_at_broker rigth?

marketposition_at_broker of course does not work in backtest, therefore i need to have 2 code one to go at market and one for simulation; shouldn't be possible for you to modify the function marketposition_at_broker that if i'm in simulation works like currentshares?

last question: should i use marketposition_at_broker inside of Setprofittarget?

Code: Select all

Setprofittarget(marketposition_at_broker*(entryprice + entryprice * vol_perc*Perc_TargetLong/100)-marketposition_at_broker*entryprice);

User avatar
Henry MultiСharts
Posts: 9165
Joined: 25 Aug 2011
Has thanked: 1264 times
Been thanked: 2957 times

Re: doubt with currentshares

Postby Henry MultiСharts » 04 May 2016

hi team, i still have little doubt with currentshares.

if i use "sinc" mode and i got partial order fill (for eg. fill 5 instead of 10), currentshares should be 5 correct? therefore in this case is same of marketposition_at_broker rigth?
Hello waldem,

If position matching is True then yes.
marketposition_at_broker of course does not work in backtest, therefore i need to have 2 code one to go at market and one for simulation; shouldn't be possible for you to modify the function marketposition_at_broker that if i'm in simulation works like currentshares?
Unfortunately there is no way to change that. You can use marketposition*currentshares in backtesting. Whether the chart is backtesting or auto trading can be found out using GetAppInfo(aiStrategyAuto).
last question: should i use marketposition_at_broker inside of Setprofittarget?

Code: Select all

Setprofittarget(marketposition_at_broker*(entryprice + entryprice * vol_perc*Perc_TargetLong/100)-marketposition_at_broker*entryprice);
Please check the SetProfitTarget description to make sure you understand how it works.

waldem
Posts: 115
Joined: 18 Nov 2013
Has thanked: 3 times
Been thanked: 4 times

Re: doubt with currentshares

Postby waldem » 04 May 2016

thank you as usual; GetAppInfo(aiStrategyAuto) should be very useful for me but unfortunately works only with order confirmation, and i never use it.
in automate trading i cannot believe who use order manual confirmation.

shouldn't be modified to get 1 in all the automated cases?

User avatar
Henry MultiСharts
Posts: 9165
Joined: 25 Aug 2011
Has thanked: 1264 times
Been thanked: 2957 times

Re: doubt with currentshares

Postby Henry MultiСharts » 20 May 2016

thank you as usual; GetAppInfo(aiStrategyAuto) should be very useful for me but unfortunately works only with order confirmation, and i never use it.
in automate trading i cannot believe who use order manual confirmation.

shouldn't be modified to get 1 in all the automated cases?
Hello waldem,

I'm not sure I am following. Have you mixed up aiStrategyAuto and aiStrategyAutoConf ?

waldem
Posts: 115
Joined: 18 Nov 2013
Has thanked: 3 times
Been thanked: 4 times

Re: doubt with currentshares

Postby waldem » 20 May 2016

probably you are rigth... as usual....
i need to deep investigate.
thanks


Return to “MultiCharts”