Close strategy

Strategies are published here.

Moderator: admin

Re: Close strategy

Postby rehan727 » Fri Jan 07, 2011 4:01 pm

Probably found the solution as well. Maybe OP can update in the next version.
Original code
Code: Select all
    while true do
     local row = enum:next();
     if row == nil then break end
     strategy.parameters:addStringAlternative("Symbol", row.Instrument, "", row.Instrument);
    end 


New code . Only change is the addition of code line enum:reset(); immediately after end
Code: Select all
    while true do
     local row = enum:next();
     if row == nil then break end
     strategy.parameters:addStringAlternative("Symbol", row.Instrument, "", row.Instrument);
    end
-- addition 
 enum:reset();
rehan727
 
Posts: 2
Joined: Fri Jan 07, 2011 10:53 am

Re: Close strategy

Postby midnightvulture » Mon Jan 17, 2011 8:16 am

Hi Alexander,

Is the LevelCloseStrategy compatible with dbfx please?

Regards,

Alex
midnightvulture
 
Posts: 3
Joined: Wed Dec 29, 2010 3:18 am

Re: Close strategy

Postby Apprentice » Mon Jan 17, 2011 1:06 pm

If you are using Trade Station II (Marketskop) you can use this strategy.
User avatar
Apprentice
FXCodeBase: Confirmed User
 
Posts: 36435
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia

Re: Close strategy

Postby davidf515 » Wed Feb 09, 2011 2:50 am

This strategy is EXACTLY what I need, which is why this is so frustrating! Why will this not work on US accounts? Applied it yesterday to a US practice account and, as has been noted in this thread, I just got a series of error notifications. I assume that the problem has something to do with our lovely FIFO handicap here in the States, but is there NO WAY around this? I just want ALL of my positions to close when I get to a certain Total Gain / Loss. Is there anything that can be done for us poor souls under the CFTC's thumb, er, protection?

Any help you can give would be greatly appreciated.
davidf515
 
Posts: 42
Joined: Wed Feb 09, 2011 2:31 am

Re: Close strategy

Postby NID007 » Tue Mar 08, 2011 8:42 am

Hi Nikalay ,


I would please like to know ,is there a strategy that closes all profitable trades . Also limit order in pips ,settable to less than one pip . ie ,,0.2, 0.3 0.4 , 0.5 etc .

I ve got the level close strategy which is settable ,but it only closes one trade at a one time ,then strategy shuts itself off .

Hope you can assist.

Many thanks

Nid007
NID007
 
Posts: 30
Joined: Mon Feb 14, 2011 3:35 pm

Re: Close strategy

Postby lisa_baby_xx » Fri Jun 03, 2011 4:25 am

Hi Guys,

There is a problem with the sound file with this stratagy, it will not allow me to specilfy one. :(

Much love guys. XX
lisa_baby_xx
lisa_baby_xx
 
Posts: 76
Joined: Sun Apr 17, 2011 5:37 am


Re: Close strategy

Postby 4xtr8r » Thu Jun 09, 2011 9:57 pm

Hi,

Is there a way you can set how many lots you would like to sell instead of it selling everything?

Thank you!
4xtr8r
 
Posts: 29
Joined: Fri Sep 03, 2010 2:19 pm

Re: Close strategy

Postby Ancient » Fri Jun 10, 2011 3:13 am

Apprentice wrote:Sound bug fixed.


What about the bug that disables Currency Selection after the Strategy Closes the Trades?

Reminder:
Ancient wrote:When Strategy is loaded the first time, User is able to Select ALL Instruments or One Instrument.

However, when Market reaches the defined level and Strategy is Disabled / Stopped, then if User attempts to Re-Set the Properties in order to Re-Activate / Re-Start the Strategy, User is unable to Edit the previously Selected Option pertaining to Instruments.

User has to Re-load the Strategy from Manage Custom Strategies go to Manage Strategies, Add the Strategy and then only is the User able to Select Instrument Options either ALL Instruments or ONE Instrument.


The suggestion below, although temporarily provides a solution, is somewhat of a dangerous approach in the sense that the User may have forgotten to reset the properties before initiating New Trades ...

JJBungles wrote:When the strategy executes (Closes the trades) it is turned off and a red dot shows up on the strategy manager.

Menu is Strategies --> Manage Strategies.

Select the strategy and start it again. When it goes green you can change the settings.


The Correction or Additional Code suggested below ... well, I am not sure that it works. I added the Code as per example, but No Solution ...

rehan727 wrote:Probably found the solution as well. Maybe OP can update in the next version.
Original code
Code: Select all
 while true do
local row = enum:next();
if row == nil then break end
strategy.parameters:addStringAlternative("Symbol", row.Instrument, "", row.Instrument);
end


New code . Only change is the addition of code line enum:reset(); immediately after end
Code: Select all
 while true do
local row = enum:next();
if row == nil then break end
strategy.parameters:addStringAlternative("Symbol", row.Instrument, "", row.Instrument);
end
-- addition
enum:reset();


Lastly, what still is missing, if this Strategy is to realise its full potential, is the ability to select Instruments Selectively, instead of either All or Only One... i.e. Out of the Say 20 Listed Instruments, the ability to select 3 or 4 etc out of the 20...

-------------------------------------
Ancient
 
Posts: 45
Joined: Thu Nov 04, 2010 6:55 pm

Re: Close strategy

Postby fabfxcm » Thu Aug 25, 2011 8:50 am

Hi everybody,
I tried to test the level close strategy, but it appear the following error: string 90 unsopported! What does it means? What I have to do?
Thank you
fabfxcm
 
Posts: 23
Joined: Mon Jan 17, 2011 5:50 am

PreviousNext

Return to Custom Strategies

Who is online

Users browsing this forum: No registered users and 13 guests