stevehopwoodforex.com
https://www.stevehopwoodforex.com/phpBB3/
Print view

NB 10.6 + TCO Automated 10.6
https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?t=3212
Page 20 of 21
Author:  elljay58 [ Sun Dec 22, 2013 1:41 am ]
Post subject:  Re: NB 10.6 + TCO Automated 10.6

Hi all,
I have set up TCO but seem to have missed something along the way :oops:
I think it has something to do with the PipStep code. my PipStep = 25
What is happening is that tco will take say a "long order" perfectly but if price drops say 50 pips then triggers another long order
it takes it as well, even though the first long is now in draw down :o
I have had a look through the code to see if i could find a setting that would only allow tco to trigger a second long order if
price was greater than the previous order by the PipStep() "opposite for sell orders" but I can not find any such settings.

So if anyone could help me out I would be very grateful

Oh and before I forget Have a "Marry Christmas and a very prosperous New Year" to one and all :xm:

Les
Author:  milanese [ Sun Dec 22, 2013 2:07 am ]
Post subject:  Re: NB 10.6 + TCO Automated 10.6

elljay58 wrote:Hi all,
I have set up TCO but seem to have missed something along the way :oops:
I think it has something to do with the PipStep code. my PipStep = 25
What is happening is that tco will take say a "long order" perfectly but if price drops say 50 pips then triggers another long order
it takes it as well, even though the first long is now in draw down :o
I have had a look through the code to see if i could find a setting that would only allow tco to trigger a second long order if
price was greater than the previous order by the PipStep() "opposite for sell orders" but I can not find any such settings.

So if anyone could help me out I would be very grateful

Oh and before I forget Have a "Marry Christmas and a very prosperous New Year" to one and all :xm:

Les
Hi Les,

maybe you will try to set UsePipstep to false, like the settings you find on page one of this thread..

Cheers :xm:

Tommaso
Author:  elljay58 [ Sun Dec 22, 2013 4:51 am ]
Post subject:  Re: NB 10.6 + TCO Automated 10.6

Tommaso

Thanks for that i will try it and see if it's the problem.

Update; After turning “UsePipStep” to false I am still getting subsequent LongOrder that are lower than the initial LongOrder, it would seem there is only one way to stop this from happening, by setting “MaxOrdersPerPair” = 1

Cheers :xm:

Les
Author:  elljay58 [ Mon Jan 06, 2014 10:15 am ]
Post subject:  Re: NB 10.6 + TCO Automated 10.6

:party: :yahoo: Happy New Year every one, i hope we all made it to 2014 in one piece :yahoo: :party:

Hi guys;
I have been using TCO now for a couple of week (I know just a babe in the woods eh) Haha,
Any ways I have found a couple of brick walls that I have run into.

1, I every time I have a profit and I have TrailingStop = true I get an error each time the TrailingStop moves up/down with price
"Buy Trailing Stop-Error 1: no error"

// Buy Trailing Stop Function

Code: Select all

 void BuyTrailingStop(string argSymbol, int argTrailingStop, int argMinProfit,
     int argMagicNumber)
     {
       for(int Counter = 0; Counter <= OrdersTotal()-1; Counter++)
         {
           OrderSelect(Counter,SELECT_BY_POS);           
           // Calculate Max Stop and Min Profit
           double MaxStopLoss = MarketInfo(argSymbol,MODE_BID) -
             (argTrailingStop * PipPoint(argSymbol));
           double PipsProfit = MarketInfo(argSymbol,MODE_BID) - OrderOpenPrice();
           double MinProfit = argMinProfit * PipPoint(argSymbol);           
           // Modify Stop 
           if(OrderMagicNumber() == argMagicNumber && OrderSymbol() == argSymbol
             && OrderType() == OP_BUY && OrderStopLoss() < MaxStopLoss
             && PipsProfit >= MinProfit)
             {
               while(IsTradeContextBusy()) Sleep(100);//Sleep(10);   //--- Modified by ck
               bool Trailed = OrderModify(OrderTicket(),OrderOpenPrice(),MaxStopLoss,
                 OrderTakeProfit(),0);
                    if(Trailed == false)
                 {
                   int ErrorCode = GetLastError();
                   string ErrDesc = ErrorDescription(ErrorCode);
                   string ErrAlert = StringConcatenate("Buy Trailing Stop - Error ",
                     ErrorCode,": ",ErrDesc);
                   Alert(ErrAlert);
                   string ErrLog = StringConcatenate("Bid: ",
                     MarketInfo(argSymbol,MODE_BID)," Ticket: ",OrderTicket()," Stop: ",
                     OrderStopLoss()," Trail: ",MaxStopLoss);
                   Print(ErrLog);
                 }
               }
             }
           }
To get around this I have disabled the error handling for the Trailing Stop Function, this is obviously only till I find a fix and while demo trading it. The Trailing Stop works fine by the way.

2, I still have not found a way to stop TCO from taking subsequent trades when the prior trade is in drawdown.
So as a work around I have set the
Use_PipStep = true;
PipStep = 100;

I then check the platform each hour and if an unwanted trade has been taken I delete it ASAP, this too is not ideal.
So if anyone could point me in the right direction so that I could fix these two problems it would be appreciated.

Les
Author:  milanese [ Mon Jan 06, 2014 10:23 am ]
Post subject:  Re: NB 10.6 + TCO Automated 10.6

elljay58 » Mon Jan 06, 2014 10:15 am wrote:....
2, I still have not found a way to stop TCO from taking subsequent trades when the prior trade is in drawdown.
So as a work around I have set the
Use_PipStep = true;
PipStep = 100;

I then check the platform each hour and if an unwanted trade has been taken I delete it ASAP, this too is not ideal.
So if anyone could point me in the right direction so that I could fix these two problems it would be appreciated.

Les
Hi Les,

so setting “MaxOrdersPerPair” = 1 is not preventing from additional orders?

Cheers :)

Tommaso
Author:  elljay58 [ Mon Jan 06, 2014 10:51 am ]
Post subject:  Re: NB 10.6 + TCO Automated 10.6

Hi Tommaso, yes if i set "MaxOrdersPerPair" =1 TCO will only take 1 order, but this is not what i am trying to do.

I was hopping to use TCO to pyramid into trends using the "MaxOrdersPerPair"= 2 or more and only allowing the additional orders to be added once the previous order was at BreakEven.
Now after reading the code over the last two weeks or so :( i could not find any settings in the code that would allow this to be done.
So i thought i would ask again and see if any one had any ideas as to how this might be done. There are some very smart cookies on this forum :ugeek:

As i have said before i am not a programmer just a cut-n-past guy, however yesterday i downloaded MQL4_by_codersguru.zip it is recomended by Steve in another thread and i intend to learn how to program, how long this will take ha-ha how long is a piece of string!

Les
Author:  milanese [ Mon Jan 06, 2014 11:25 am ]
Post subject:  Re: NB 10.6 + TCO Automated 10.6

elljay58 » Mon Jan 06, 2014 10:51 am wrote:Hi Tommaso, yes if i set "MaxOrdersPerPair" =1 TCO will only take 1 order, but this is not what i am trying to do.

I was hopping to use TCO to pyramid into trends using the "MaxOrdersPerPair"= 2 or more and only allowing the additional orders to be added once the previous order was at BreakEven.
Now after reading the code over the last two weeks or so :( i could not find any settings in the code that would allow this to be done.
So i thought i would ask again and see if any one had any ideas as to how this might be done. There are some very smart cookies on this forum :ugeek:

As i have said before i am not a programmer just a cut-n-past guy, however yesterday i downloaded MQL4_by_codersguru.zip it is recomended by Steve in another thread and i intend to learn how to program, how long this will take ha-ha how long is a piece of string!

Les
Hi Les

very good you started to learn some coding :)
Here I attach a version that will only add positions if position is for MinProfitPct in win
Please use this externals for the setting:
StackingOnlyInWin = true set true for using the add
MinProfitPct= 0.5; sets the Min % needed for adding positions
with MaxOrdersPerPair you will use as so far..

Cheers :)

Tommaso
Edit:new fixed MOD
TCO_106Mod.mq4
Author:  elljay58 [ Mon Jan 06, 2014 11:54 am ]
Post subject:  Re: NB 10.6 + TCO Automated 10.6

Tommaso, Thank you so much, i will try it out tomorrow afternoon. Time for bed now as its 1:am here already and i have a lot on tomorrow morrning.
Time fly's when your having fun!

Les
Author:  milanese [ Mon Jan 06, 2014 1:40 pm ]
Post subject:  Re: NB 10.6 + TCO Automated 10.6

elljay58 » Mon Jan 06, 2014 11:54 am wrote:Tommaso, Thank you so much, i will try it out tomorrow afternoon. Time for bed now as its 1:am here already and i have a lot on tomorrow morrning.
Time fly's when your having fun!

Les
Hi Les and all,

please redownload, as known :lol:, I made some error in the first version uploaded.. now fixed you find the modified version two posts before..

Cheers :)

Tommaso
Author:  lonelytrader [ Tue Jan 07, 2014 4:13 am ]
Post subject:  Re: NB 10.6 + TCO Automated 10.6

I have a hopefully interesting question.

NB 10.6 was designed for 4h trading, but with this version of TCO its running on 1h.
what about actually running it on 4h? I tried playing with the TF in the EA, by moving everything up one level, so 240/10080 and it seems to have less trades but better ROI, any thoughts?

I cant be the only one who thought of trying it out.
All times are UTC Page 20 of 21