[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[amibroker] Apply Stop



PureBytes Links

Trading Reference Links

Dear Support



I would like to write a trailing stop formula, that in some ocassion the type of the stop have to change.




example:
 

for( i = 2 ; i < BarCount; i++ )
{
  if (High[i]>bekapcs_L[i] AND bekapcs_L[i]>0)
    {
       alap_stop[i]=2;
    }
       else
    {
        if (bekapcs_L[i]>0 AND alap_stop[i-1]>0)
        {
           alap_stop[i]=alap_stop[i-1];
        }
        else
        {
           alap_stop[i]=0;

            }

    }
}



version1
**********************************************************************
for( i = 2 ; i < BarCount; i++ )
{
    if (i == BarCount-1 AND alap_stop[i]>0)
    {
        ApplyStop(2,Sstopmode,(TickSize)*(10+spread_x/2),True );
    }
    else
    {
        ApplyStop(0,Sstopmode,(TickSize)*(10+spread_x/2),True );
    }
}
**********************************************************************



********* or *****************

version2
**********************************************************************

        ApplyStop(iif(alap_stop==2,2,0),Sstopmode,(TickSize)*(10+spread_x/2),True );

**********************************************************************


I tried the previous two formula, but they don't works.


So i need a formula wherewith:
if the prices moves x point, the stoptypeloss must be change to stoptypetrail.


Could you give me some advice about my problem?


Best regards
Gabor Vidovics



------------------------------------

**** IMPORTANT PLEASE READ ****
This group is for the discussion between users only.
This is *NOT* technical support channel.

TO GET TECHNICAL SUPPORT send an e-mail directly to 
SUPPORT {at} amibroker.com

TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
http://www.amibroker.com/feedback/
(submissions sent via other channels won't be considered)

For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/amibroker/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/amibroker/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:amibroker-digest@xxxxxxxxxxxxxxx 
    mailto:amibroker-fullfeatured@xxxxxxxxxxxxxxx

<*> To unsubscribe from this group, send an email to:
    amibroker-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/