Signal - time condition and crosses above

Questions about MultiCharts and user contributed studies.
filippo.milano
Posts: 44
Joined: 02 Jan 2015
Has thanked: 1 time

Signal - time condition and crosses above

Postby filippo.milano » 31 May 2017

Hi everyone,
i will try to explain my problem.
I'm building a signal.
I have 2 condition:

Code: Select all

if time > 1200 and close crosses above var0 then
begin
buy
end;
whatching the graph it seems that the condition

Code: Select all

close crosses above var0
have to be true from time > 0000

So, if close crosses above var0 will be verify after time = 0000 and time > 1200 it will open the position.
But it's wrong!
I'd like that the condition

Code: Select all

Close crosses above var0
have to be verify after time = 1200. So the condition should be checked only for time > 1200

I say sorry for my english and i hope somebody can understand and help me.

Many thanks in advance.

Filippo

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

Re: Signal - time condition

Postby TJ » 31 May 2017

No need to apologise for your English; it is fine. MultiCharts is an International community with people from countries around the World.


What is your chart resolution?

filippo.milano
Posts: 44
Joined: 02 Jan 2015
Has thanked: 1 time

Re: Signal - time condition and crosses above

Postby filippo.milano » 31 May 2017

Thanks TJ!

5 minutes

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

Re: Signal - time condition and crosses above

Postby TJ » 31 May 2017

You need to post your chart.

You need to point out the location where you think the order should be triggered.


The error is in your logic.

Your code snippet is not enough for debugging.
You need to post more codes, and more explanation.

filippo.milano
Posts: 44
Joined: 02 Jan 2015
Has thanked: 1 time

Re: Signal - time condition and crosses above

Postby filippo.milano » 31 May 2017

You were right the problem it's in the logic, i found some problems!
Many thanks!!!!
But, right now, in the same code i have another problem... in the code i use

Code: Select all

VolWAPValue
and for the code, if i write something like

Code: Select all

VolWAPValue + var0
it's ok, but i write

Code: Select all

VolWAPValue - var0
i have problems. The signal doesn't work as it should.

i'm trying to fix it so i can understand well the logic.

Could you just tell me if i write

Code: Select all

VolWAPValue - var0
if can have some problems?

VolWAPValue it's calculate like this:

Code: Select all

if ShareW > 0 then
begin
VolWAPValue = PriceW / ShareW;
end;
Could you also, kindly, let me know where i can find weekly cycle code logic?

Many thanks in advance and have a nice evening

Filippo

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

Re: Signal - time condition and crosses above

Postby TJ » 31 May 2017

Regarding var0,

see post #5
viewtopic.php?t=11713


Return to “MultiCharts”