Trading_commands

Here you can post and download custom indicators. PLEASE: Do not start topics unless you are posting your own indicator, they will be moved to appropriate section even if you do.

Moderator: admin

Re: Trading_commands

Postby Apprentice » Sun Feb 11, 2018 5:19 am

Unfortunately Closed Trades table it does not provide information about the order type.
Close time is provided, so we can use this as a reference point.
With which indicator/strategy this will be used.
User avatar
Apprentice
FXCodeBase: Confirmed User
 
Posts: 19586
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia

Re: Trading_commands

Postby 7000306337 » Sun Feb 11, 2018 9:34 pm

Cordial thanks for your valuable time and reply. Much appreciated.

I`m not using any STANDARD INDICATOR or STRATEGY.

I`m struggling with a STRATEGY that I`m trying to create.
I got it working to enter() correctly and exit() correctly on a PegPriceOffsetPipsStop STOP or a PegPriceOffsetPipsLimit LIMIT.

The only problem left now is how to prevent entering() again till end of current candle.
Because for the rest of the current candle both enter() and exit() conditions are still simultaneously valid till end of current candle which results in thousands of enter() and exactly the same number of thousands of exit().

Wish there was a way (or a work around) to limit number of enter() per candle to ONLY ONE(1) trade.
7000306337
 
Posts: 26
Joined: Sat Jul 15, 2017 9:48 am

Re: Trading_commands

Postby 7000306337 » Sun Feb 11, 2018 10:05 pm

Thank you thank you ....

That is it ...
I will set a flag=true if enter() is executed once, to prevent entering() again.
And reset flag=false on each new candle.
That should work.
I`ll try it.
7000306337
 
Posts: 26
Joined: Sat Jul 15, 2017 9:48 am

Re: Trading_commands

Postby 7000306337 » Mon Feb 12, 2018 7:20 am

Sincerest Gratitude ... can`t thank you enough for your valuable time and mentor.

Just wanted to mention that the flag on ................................... enter() .... worked just fine.
I was trying to solve the wrong problem by trying to set a flag on ....... exit().
(there are many exits() and the STOP and LIMIT exits() are hard to track)

As always much much appreciated,
Thanks again.
7000306337
 
Posts: 26
Joined: Sat Jul 15, 2017 9:48 am

Re: Trading_commands

Postby 7000306337 » Mon Feb 12, 2018 2:24 pm

Hi:
Me again.

Just a quick question;
Can extSignale() be used in INDICATORS (any example)? or it is only for STRATEGIES.

If not is there a way to mimic it in INDICATORS?

txs,
7000306337
 
Posts: 26
Joined: Sat Jul 15, 2017 9:48 am

Re: Trading_commands

Postby Apprentice » Fri Feb 16, 2018 7:32 am

Only for STRATEGIES.
User avatar
Apprentice
FXCodeBase: Confirmed User
 
Posts: 19586
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia

Re: Trading_commands

Postby alerander81 » Fri Jul 27, 2018 9:31 am

Hi Apprentice,

Thanks you very much for this indicator !

But in order to have more results, Is it possible to add these functions :

- We open a position, short or long, manually (example, a Buy position with 20 lots)

- Then the price reach first take profit (for example 6 pips, definied in indicator parameters), the indicator close 1/2 of this position automatically (10 lots so), and in the same time, the indicator move automactically the fixed stop to breakeaven + 1 pips.

- Then the price reach the second take profit (for example 12 pips, definied in indicator parameters), the indicator close again automatically 1/2 of the position (5 lots so), and again in the same time automatically change the fixed stop to trailing stop.

By this behaviour we secure trades with an automatic way with the breakeaven, as the same time as we have closed 75% of the position, with 25% is running if we have a market acceleration.

Thanks you in advance.
alerander81
 
Posts: 3
Joined: Thu May 03, 2018 5:58 am

Re: Trading_commands

Postby Apprentice » Mon Jul 30, 2018 9:57 am

Your request is added to the development list under Id Number 4202
User avatar
Apprentice
FXCodeBase: Confirmed User
 
Posts: 19586
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia

Re: Trading_commands

Postby Apprentice » Mon Jul 30, 2018 12:29 pm

There is a strategy which does almost exactly that. I modified it a little bit to fit exactly to the requirements.
Trailing_stop_limit_2.lua
(50.15 KiB) Downloaded 90 times

Trailing_stop_limit_all trades.lua
(51.76 KiB) Downloaded 70 times
User avatar
Apprentice
FXCodeBase: Confirmed User
 
Posts: 19586
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia

Re: Trading_commands

Postby alerander81 » Tue Jul 31, 2018 8:22 am

Hi,

I can't use the strategy when no trades are present on open positions.

Is it possible to activate the strategy (in stand-by mode) when no trades are open?
Then when we open a position the strategy detect this?

Thanks !
alerander81
 
Posts: 3
Joined: Thu May 03, 2018 5:58 am

PreviousNext

Return to Custom Indicators

Who is online

Users browsing this forum: No registered users and 21 guests