Easylanguage and day after

Questions about MultiCharts and user contributed studies.
Superchart
Posts: 4
Joined: 07 Jan 2014

Easylanguage and day after

Postby Superchart » 07 Jan 2014

Good day to all members of the forum.
My name is Paul and I'm a new member.
I need some help.
I'm trying to complete a strategy but I dont understand wher's the mistake.
The system opens a long or a short position.
This position must be closed the day after at 09.30 am
I wrote this code but it is wrong.
Can You help me find the error, thanks

.......
if Time = 915 and c of data2 <= c [24] of data2 then
setprofittarget (0);

if Time> = 930 and time <1730 then begin
exitlong;
exitshort;
end;
.......

Thank you so much
Paolo

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

Re: Easylanguage and day after

Postby TJ » 10 Jan 2014

Good day to all members of the forum.
My name is Paul and I'm a new member.
I need some help.
I'm trying to complete a strategy but I dont understand wher's the mistake.
The system opens a long or a short position.
This position must be closed the day after at 09.30 am
I wrote this code but it is wrong.
Can You help me find the error, thanks
......
if Time = 915 and c of data2 <= c [24] of data2 then
setprofittarget (0);
if Time> = 930 and time <1730 then begin
exitlong;
exitshort;
end;
.......
Thank you so much
Paolo
See post #5
viewtopic.php?f=16&t=10811


What are your chart's data resolutions?

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

Re: Easylanguage and day after

Postby TJ » 10 Jan 2014

ps.
[FAQ] How to Post Codes (that people can read)
viewtopic.php?f=16&t=11713

Superchart
Posts: 4
Joined: 07 Jan 2014

Re: Easylanguage and day after

Postby Superchart » 11 Jan 2014

Tj thanks so much for your response.
I use 15 minutes

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

Re: Easylanguage and day after

Postby Henry MultiСharts » 14 Jan 2014

Hello Paolo,

What is the exact difficulty you have with the code?
What exact code does not do what it is intended to do?

Superchart
Posts: 4
Joined: 07 Jan 2014

Re: Easylanguage and day after

Postby Superchart » 14 Jan 2014

Henry, thank You for help me.
I want to close the position (- long or short - position I have open the day before) the next day at 09.30. But when I enter this command:

if Time> = 930 and time <1730 then begin
exitlong;
exitshort;
end;

This command is not accepted by easylanguage and I can not use this system.

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

Re: Easylanguage and day after

Postby Henry MultiСharts » 14 Jan 2014

There are no "exitlong" and "exitlong" commands in PowerLanguage.

Buy and SellShort commands are for opening a position.
Sell and BuyToCover commands are for closing a position.

Complete list of PowerLanguage Keywords can be found at this page under PowerLanguage Keyword Reference section:
https://www.multicharts.com/trading-sof ... /Main_Page

Superchart
Posts: 4
Joined: 07 Jan 2014

Re: Easylanguage and day after

Postby Superchart » 14 Jan 2014

Thanks Henry, I completed the system.
Now I have a new problem, all my system is based on a time frame of 15 minutes but I have to open a new position 10 second before the close of the market..... How I can solve this problem??

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

Re: Easylanguage and day after

Postby Henry MultiСharts » 14 Jan 2014

Thanks Henry, I completed the system.
Now I have a new problem, all my system is based on a time frame of 15 minutes but I have to open a new position 10 second before the close of the market..... How I can solve this problem??
Please find the code example here.


Return to “MultiCharts”