Replies

diogene823
19 Jul 2013, 08:29

hahahah thanks Nego.

"Hi there, I really dont understand why you have the Stop(); within the foreach part."

Because i am THE JACKASS of the development, i write my first line of code two week ago.

Im going crazy for 4 days for the difference about this:

foreach (var openedPosition in Account.Positions)
            {
               Trade.Close(openedPosition);
            }
            Stop();

AND THIS

foreach (var openedPosition in Account.Positions) { Trade.Close(openedPosition);
Stop(); }

I'm going crazy because i don't understand that the foreach is a loop i think that the loop is a specific order, and Trade.Close(openedPoistion) is a order to close all position, not a loop to close one position every round of loop. Another software that i use, not for trading, have the loop only if you declare the loop. (this software is not a development software, is a object development software).

Sorry for my poor english.

Bye and thank you

 

@diogene823

diogene823
18 Jul 2013, 17:41

Hi yes it works, i'm wrong understand your post for two reasons:

1) i know the characters // but you write

                //if (position.GrossProfit  > 0)
                //{
                    Trade.Close(position);
                //}

and i have see:

//if (position.GrossProfit  > 0)
                //{
                //     Trade.Close(position);
                //}

2) before opening this topic i have test this:


 if(Account.Equity > 1){
            foreach (var position in Account.Positions)
            {
                {
                    Trade.Close(position);

                    Stop();
                }
            }
    }


But so the robot close only the oldest trade and off himself.

Now i understand why!!!


I solved this way: 


protected override void OnPositionClosed(Position position)
        {
            if(Account.Positions.Count == 0)
            {
                Stop();
               } 
        }

So the robot shut down himself only after closing all.

I am truly grateful for your suggestion. Thanks and Bye

 


@diogene823

diogene823
17 Jul 2013, 18:00

so in need only this:

var netProfit = 0.0;

            foreach (var openedPosition in Account.Positions)
            {
              netProfit += openedPosition.NetProfit;               
            }
            if(Account.Equity > Equity) 
            {
            foreach (var openedPosition in Account.Positions)
            {
               Trade.Close(ALL THE POSITION; PLEASE DARLING ROBOT CLOSE ALL; PLEASE!!!!!);
               Stop();
            }


but so don't work hahahaah


@diogene823

diogene823
17 Jul 2013, 17:57

Thanks breakermind, but your robot close all trade only if this trade have a profit > of zero

I need a robot that close all the trade (the trade in profit and the trade in loss) if the equity is XXX,

it's different.

 

Thanks and Regards


@diogene823

diogene823
17 Jul 2013, 11:48

Thank's Support,

just wondering who you thought.

 

@kricka you idea was good, but i think that i's more simple for the developers add an option to Quicktrade with a flag "will you confirm always the close all button?"

and with the flag, if you click on close all button appears a popup whit the question if you will continue or not.


Bye


@diogene823

diogene823
12 Jul 2013, 13:10

sorry for the words run together it's a problem of the forum because before i submit the message was normal...


@diogene823

diogene823
22 May 2013, 22:56

Thanks Atrader,

but if the robot trailing more than one trade and you will follow only one trade manualy?

Thanks

Regards


@diogene823

diogene823
20 May 2013, 14:14

Sorry, it's possible change the label of an order?

For example if i have a trailing stop robot that follow all trade with a specify label

and i will that today one trade it's not follow from the robot but follow manually i change the label of this trade and

the robot don't follow it anymore.

When i will that the robot follow this trade again i change the label whit the old label...

it's possible?

Thanks all for the answer.


@diogene823