Strategy not producing same values as indicators putting out .

Questions about MultiCharts and user contributed studies.
Rick Webber
Posts: 51
Joined: 04 Jan 2008
Has thanked: 21 times
Been thanked: 3 times

Strategy not producing same values as indicators putting out .

Postby Rick Webber » 12 Apr 2024

I've gone and checked that strategy and indicator have same days loaded and I am not using IOG but I am unable to duplicate values put out by my indicators in my strategies. Even duplicating the code directly into strategy from indicator does not resolve it so I am thinking of digging into documentation on Bamboo's ADE with the idea of placing the indicator values into a holder and being able to have the strategy retrieve those values to see if this might resolve my problem. Does this sound possible or will I just be wasting my time. Thanks for any input.

User avatar
TJ
Posts: 7743
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2222 times

Re: Strategy not producing same values as indicators putting out .

Postby TJ » 13 Apr 2024

If this is a coding question, you have to post the codes.

Indicators are calculated in real time. ie similar to IOG.
Strategies are calculated at End of Bar (EOB).

Rick Webber
Posts: 51
Joined: 04 Jan 2008
Has thanked: 21 times
Been thanked: 3 times

Re: Strategy not producing same values as indicators putting out .

Postby Rick Webber » 13 Apr 2024

Appreciate your input. I was going on this statement found in the wiki. "On the historical data the indicator is calculated on the bar close values only. There are multiple historical data calculation modes for the signal. In order for the indicator and signal historical calculations to match, IOG and Bar Magnifier should be disabled for the signal."
I have another question as I'm digging into ADE and my first attempt has brought a EL Collections error "List Index is out of bounds". I'm applying it to a 6 point chart so now thinking I should try using ADE for Type Zero Bars as point bars are constructed from tick bars(Type Zero) but Point bars have a bartype=5. Question is, will Type Zero functions work on Point bars ? Hoping this will remedy the error. Code is quite extensive, hoping to avoid having to post that.

User avatar
BB123
Posts: 69
Joined: 24 Nov 2023
Has thanked: 23 times
Been thanked: 11 times

Re: Strategy not producing same values as indicators putting out .

Postby BB123 » 13 Apr 2024

Global Variables might work well for you Rick.. Put the value into a GV and then pull that value out and use it in another Script..

MoeMiami
Posts: 6
Joined: 09 Apr 2024
Been thanked: 1 time

Re: Strategy not producing same values as indicators putting out .

Postby MoeMiami » 14 Apr 2024

Did you uncheck the update on every tick option on the indicator? It should be the same once you uncheck that.

User avatar
BB123
Posts: 69
Joined: 24 Nov 2023
Has thanked: 23 times
Been thanked: 11 times

Re: Strategy not producing same values as indicators putting out .

Postby BB123 » 14 Apr 2024

also.. just a thought-- if your using tick based bars vs time based bars-- you need to use the _s suffix reserved words...

Example = LastBarOnChart_s vs LastBarOnChart

Rick Webber
Posts: 51
Joined: 04 Jan 2008
Has thanked: 21 times
Been thanked: 3 times

Re: Strategy not producing same values as indicators putting out .

Postby Rick Webber » 18 Apr 2024

Thanks you guys, appreciate the suggestions. I have unchecked "update every tick", problem persists and I am trying GV AccuracySetNamedDouble
but it returns "0" but still a couple more to try. The code paints my bars green when the code produces a # >= 5 or red if the total is <= -5 , yellow in between. I have tried using LastBarOnChart_s and without "s" but my indicator quits wording as soon as it compiles. Not sure why. Also I am trying to get the newest versions of ELCollections and ADE 2.1 and whats available in TS forum has an installer that goes with it that requires TS 9.1 or higher for it to install directly. How do we get this into MultiCharts ? I have older versions ELC 1.05 and ADE 1.07 but newest is 2.01 and a new dll ELCollections2.dll

Rick Webber
Posts: 51
Joined: 04 Jan 2008
Has thanked: 21 times
Been thanked: 3 times

Re: Strategy not producing same values as indicators putting out .

Postby Rick Webber » 22 Apr 2024

Found out my problem with strategy syncing with indicator data has to do with data2. As long as I have a reference to data2 in the variables of any kind I instantly lose synchronization between my indicator and the strategy. Now I just need to figure out why. Any help appreciated.

User avatar
Mark Brown
Posts: 184
Joined: 29 Nov 2016
Has thanked: 119 times
Been thanked: 18 times

Re: Strategy not producing same values as indicators putting out .

Postby Mark Brown » 28 Apr 2024

If this is a coding question, you have to post the codes.

Indicators are calculated in real time. ie similar to IOG.
Strategies are calculated at End of Bar (EOB).
Hopeful after more than a decade.

It’s now possible to send automatic orders based on additional calculation events, regardless of the IOG mode. These new settings are added to the Format Signal dialog in the Properties tab


Return to “MultiCharts”