Hi all, i'am new of the Forum and i've a question.
How can i set different strategies on different charts, setting them in OR ?
For example:
sys 1 = DAX
sys 2 = FIB
sys 3 = XX
and i would like to have not more then one active system in my broker.
Is it possibile ?
How can i trace marketposition from another chart ?
Best regards.
MultiCharts AND/OR Trading Systems setting
- Henry MultiСharts
- Posts: 9165
- Joined: 25 Aug 2011
- Has thanked: 1264 times
- Been thanked: 2957 times
Re: MultiCharts AND/OR Trading Systems setting
Hello,
A strategy can be trading only one instrument that is the main data series of your chart. You need to create a chart for each symbol you want to trade. Then apply a strategy you would like to be trading on this chart.
That is not possible to trace marketposition for a certain instrument from a code applied to a different chart. You can check the marketposition for the instrument/strategy in File->New->Order and position tracker window->Open positions/Strategy posiions.
A strategy can be trading only one instrument that is the main data series of your chart. You need to create a chart for each symbol you want to trade. Then apply a strategy you would like to be trading on this chart.
That is not possible to trace marketposition for a certain instrument from a code applied to a different chart. You can check the marketposition for the instrument/strategy in File->New->Order and position tracker window->Open positions/Strategy posiions.
- Henry MultiСharts
- Posts: 9165
- Joined: 25 Aug 2011
- Has thanked: 1264 times
- Been thanked: 2957 times
Re: MultiCharts AND/OR Trading Systems setting
That is possible to transfer the information from one chart to the other with the help of Global Variables.
- Henry MultiСharts
- Posts: 9165
- Joined: 25 Aug 2011
- Has thanked: 1264 times
- Been thanked: 2957 times
Re: MultiCharts AND/OR Trading Systems setting
Have you checked the Wiki article I have provided above? It says:
Additional info on our discussion forum: viewtopic.php?t=2483
In that thread you can find a zip file Global Variable22.zip with a bunch of information and examples regarding Global Variables. You can also use search on our forum or over the Internet to find examples and more discussions on Global Variables.
Additional info on our discussion forum: viewtopic.php?t=2483
In that thread you can find a zip file Global Variable22.zip with a bunch of information and examples regarding Global Variables. You can also use search on our forum or over the Internet to find examples and more discussions on Global Variables.
Re: MultiCharts AND/OR Trading Systems setting
I tried to use it but it doesn t works.....very strange.
I wrote this code:
Code 1
Code 2
But it works just sometimes...
Then i try with this:
But i ve the same problem....
Thank you for your time, and thank you again for anyelse answer...
I wrote this code:
Code 1
Code: Select all
FLAGMA = GVSetInteger(2,flagma);
flagsto = GVGetInteger(1);
IF ( MarketPosition_at_Broker <> 0) then
flagma = 1;
if (MarketPosition_at_Broker = 0) then
flagma = 0;
IF ( marketposition <> 1 and CONDITION2 AND flagsto = 0 ) then
BUY ( "ccilong" ) 1 share NEXT BAR AT MARKET;
IF ( marketposition <> -1 and CONDITION3 AND flagsto = 0) then
SELLSHORT ( "ccishort" ) 1 share NEXT BAR AT MARKET;
Code: Select all
flagsto = GVSetInteger(1,flagsto);
flagma = GVGetInteger(2) ;
IF ( MarketPosition_at_Broker <> 0) then
flagsto = 1;
if (MarketPosition_at_Broker = 0) then
flagsto = 0;
IF ( marketposition <> 1 and CONDITION2 AND flagma = 0 ) then
BUY ( "RSILONG" ) 1 share NEXT BAR AT MARKET;
IF ( marketposition <> -1 and CONDITION3 AND flagma = 0) then
SELLSHORT ( "RSISHORT" ) 1 share NEXT BAR AT MARKET;
Then i try with this:
Code: Select all
IF ( marketposition <> 1 and CONDITION2 and MarketPosition_at_Broker = 0 ) then
BUY ( "long" ) 1 share NEXT BAR AT MARKET;
IF ( marketposition <> -1 and CONDITION3 and MarketPosition_at_Broker = 0 ) then
SELLSHORT ( "short" ) 1 share NEXT BAR AT MARKET;
Thank you for your time, and thank you again for anyelse answer...
- TJ
- Posts: 7743
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2222 times
Re: MultiCharts AND/OR Trading Systems setting
you have to put the GV after the assignment.
eg.
eg.
Code: Select all
IF ( MarketPosition_at_Broker <> 0) then
flagma = 1
else
flagma = 0;
FLAGMA = GVSetInteger(2,flagma);
flagsto = GVGetInteger(1);
IF ( marketposition <> 1 and CONDITION2 AND flagsto = 0 ) then
BUY ( "ccilong" ) 1 share NEXT BAR AT MARKET;
IF ( marketposition <> -1 and CONDITION3 AND flagsto = 0) then
SELLSHORT ( "ccishort" ) 1 share NEXT BAR AT MARKET;
Re: MultiCharts AND/OR Trading Systems setting
Yes true, thank you very much !!
But there s still a little problem, when i have two signals at they same time, variables are both 0 and both systems go on market...
Any idea to solve this problem ?
Maybe giving a delay to 1 code ? (but is not so good like solution.....)
Thx to any answer
Regards
But there s still a little problem, when i have two signals at they same time, variables are both 0 and both systems go on market...
Any idea to solve this problem ?
Maybe giving a delay to 1 code ? (but is not so good like solution.....)
Thx to any answer
Regards
- TJ
- Posts: 7743
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2222 times
Re: MultiCharts AND/OR Trading Systems setting
I can't give you any specifics without examining the code.Yes true, thank you very much !!
But there s still a little problem, when i have two signals at they same time, variables are both 0 and both systems go on market...
Any idea to solve this problem ?
Maybe giving a delay to 1 code ? (but is not so good like solution.....)
Thx to any answer
Regards
Basically you have to design a gatekeeper and execute the orders within the resolution you can manage.
Re: MultiCharts AND/OR Trading Systems setting
Hello,
i resume this discussion that can be usefull for mc users.
I would like to set some systems in OR to reduce leverage and for other scope.
This means that if i've 10 charts with 10 signals, just 1, 2 or 3 trading system can be active at the same time and not more.
I don t know if is it possibile with Portfolio Trader (i think yes) but anyway, in this case, what would happen if 8 signals will be triggered at the same time ? Can i assign a random priority ?
Regards and thanks for any answer
No Erocla
i resume this discussion that can be usefull for mc users.
I would like to set some systems in OR to reduce leverage and for other scope.
This means that if i've 10 charts with 10 signals, just 1, 2 or 3 trading system can be active at the same time and not more.
I don t know if is it possibile with Portfolio Trader (i think yes) but anyway, in this case, what would happen if 8 signals will be triggered at the same time ? Can i assign a random priority ?
Regards and thanks for any answer
No Erocla
Re: MultiCharts AND/OR Trading Systems setting
This is easily done in PT. You can use pmm_set_global_named_num() and pmm_get_global_named_num() to keep count of how many strategies have initiated positions.I don t know if is it possibile with Portfolio Trader (i think yes) but anyway, in this case, what would happen if 8 signals will be triggered at the same time ? Can i assign a random priority ?
Re: MultiCharts AND/OR Trading Systems setting
Dear Orion,
thank you very much for the answer, but i don't understand very well how to solve my problem using those funcions.
Maybe for my scope i've to:
1 - count how many equities are present in my portfolio (pmms_strategies_count)
2 - Don t allow to strategies operate before PMM Instructions (pmms_strategies_deny_entries_all)
3 - Count how many equities are active in my portoflio (pmms_strategies_in_positions_count)
4 - allow strategies to operate if there are not more then "n" equities active (??)
should be a way ? is it correct ?
Regards and thank you again
No Erocla
thank you very much for the answer, but i don't understand very well how to solve my problem using those funcions.
Maybe for my scope i've to:
1 - count how many equities are present in my portfolio (pmms_strategies_count)
2 - Don t allow to strategies operate before PMM Instructions (pmms_strategies_deny_entries_all)
3 - Count how many equities are active in my portoflio (pmms_strategies_in_positions_count)
4 - allow strategies to operate if there are not more then "n" equities active (??)
should be a way ? is it correct ?
Regards and thank you again
No Erocla
Re: MultiCharts AND/OR Trading Systems setting
There are multiple ways to do this. You can do this using the pmms keywords that you mention. You can also do this without using the pmms keywords by using the following logic. Before making an entry, a strategy checks the global variable using pmm_get_global_named_num(). If the variable is above threshold, then the strategy kills the entry signal. If the variable is below threshold, the global variable is incremented using pmm_set_global_named_num(). Also, upon exit the global variable is decremented.
Re: MultiCharts AND/OR Trading Systems setting
Ok with this cycle i can scan if there are some open position in my portfolio:
The problem occurs now, I have to check how many systems want to enter to Market, before that their signal will be triggered.
To do so, i need to scan how many trading system will change their market position:
There's any way to do it ?
Then, i will decide wich of them will open their position.
Regards and thank you again for you time
No Erocla
Code: Select all
for idx = 0 to pmms_strategies_count -1 begin
if pmms_strategy_marketposition(idx) <> 0 then
flag = 1;
end;
To do so, i need to scan how many trading system will change their market position:
There's any way to do it ?
Then, i will decide wich of them will open their position.
Regards and thank you again for you time
No Erocla