in Search

Trigger to buy/sell depending on last trade

Last post 11-23-2008, 14:37 by andwilson. 3 replies.
Sort Posts: Previous Next
  •  11-10-2008, 13:20 28175

    Trigger to buy/sell depending on last trade

    Hi,

    I would like to know if I can enable a sell short command valid if the system is was perviously sold only. Eg:

    Buy Order : Criteria-1

    Sell Order: Criteria-2

    Sell Short Order : Criteria-3

    Buy to Cover : Criteria-4

    I want system tester to apply Criteria-3 if and only if the last trade was a Sell Order (Criteria-2=True)

    I'm using Metastock 10.1 EOD.

    Thanks for your help in advance.

    Regards.

     

     

  •  11-12-2008, 15:49 28210 in reply to 28175

    Re: Trigger to buy/sell depending on last trade

    Hi aed71,

    Welcome to the forum.

    Have a look at the ValueWhen() function, or BarsSince() function.  Both of these could be used to "remember" the type of trade last executed; you might also be able to use the PREV function but I'd recommend looking at the other two options first as preferences over using PREV.

    Roy Larsen wrote an excellent tutorial on using latches in MS, he describes using specific latches to "remember" values.  The document is available in the files section of the forum.



    Hope this helps.

    wabbit Big Smile [:D]


    "The question of whether a computer can think is no more interesting than the question of whether a submarine can swim."
    Edsgar W. Dijkstra

     

    MS: 6.52 EOD, 7.x EOD, 8.0 PRO, 9.2 PRO w/QC, 10 PRO w/QC C, 11 PRO w/QC & MDK
    For custom MetaStock programming : http://www.wabbit.com.au
    My SkyPE status :
    My SkyPE account : wabbit.com.au

  •  11-15-2008, 15:23 28262 in reply to 28210

    Re: Trigger to buy/sell depending on last trade

    Thanks wabbit.

    BR/AED

  •  11-23-2008, 14:37 28315 in reply to 28175

    Re: Trigger to buy/sell depending on last trade

    At Files Section in this forum, look for the ForumDLL Manual, it has a formula called " Normal 0 Latch or Flip Flop Function" that will make you life a lot easier.
View as RSS news feed in XML