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

Re: EasyLanguage Question



PureBytes Links

Trading Reference Links

<<<
Thanks.  As long as I assume I am filled at an O-H-L-C price the method
works (in your suggestion "EntryP = C").
>>>

It was only my suggestion because the example you gave was an
"at market" order. I displayed the solution to your question as per
example.

<<<
 Now suppose it's a Buy Stop
order --e.g.

 If {Buy Setup Conditions } then
    Buy at UpperMA + 1/16 point stop.

Then one can't determine the "phantom" entry price can you??
>>>

I don't see why not. What are you doing when you place a stop
order to the floor? You are placing a flag for an order to be filled
when a specific price is hit. In other words, when the event occurs
that meets all your conditions, you now give a flag variable a value
(same as placing a stop order to your broker) that gives your
code permission to commit to an entry when a price is met.
  Thus the previous code for entry is now used to set the flag
instead of triggering an entry.

previous method...

If {Buy Setup Conditions} and SigVal<>1 then begin
    if  PF >= 2.0 then Buy("MyBuy") at Market;
    SigVal=1;EntryP=C;ESigName="MyBuy";
end;

becomes...

{new vars}
vars:SetMyB(0),SetMyS(0);

If {Buy Setup Conditions} and SigVal<>1 then begin
    if  PF >= 2.0 then SetMyB=UpperMA + 1/16;
end;

If H>SetMyB and SigVal<>1 then begin
    if  PF >= 2.0 then Buy("MyBuy") at Market;
    SigVal=1;EntryP=C;ESigName="MyBuy";
end;

SetMyB=0;{...This would go inside the entry nest above if you
wanted to erase the flag only after the stop was hit. It is placed
here assuming that the situation calls for cancelling the stop if it
is not hit on the bar after the stop order was placed.}

dbs





>>>

Ian MacAuslan wrote:

> Thanks.  As long as I assume I am filled at an O-H-L-C price the method
> works (in your suggestion "EntryP = C").  Now suppose it's a Buy Stop
> order --e.g.
>
>  If {Buy Setup Conditions } then
>     Buy at UpperMA + 1/16 point stop.
>
> Then one can't determine the "phantom" entry price can you??
>
> It seems to me this is because EasyLanguage is "bar" oriented--the only
> exception being BUY,SELL,EXIT orders, which EasyLanguage monitors
> "constantly".
>
> I've considered doing a second data stream (of smaller time frame, x) to
> monitor whether the threshold is met, at the end of each "x" unit of
> time, rather than at the end of a full bar.  Do you think this would
> work?
>
> ian
>
> >Better to keep the entry name and exit name separate for report
> >consideration.
>
> >dbs
>
> >vars:SigVal(0),ESigName(""),EntryP(0),ExitP(0),Profit(0),PF(0),
> >MP(0),XSigName("");
>
> >MP=MarketPosition;
>
> >If {Buy Setup Conditions} and SigVal<>1 then begin
> >    if  PF >= 2.0 then Buy("MyBuy") at Market;
> >    SigVal=1;EntryP=C;ESigName="MyBuy";
> >end;
>
> >if reason to exit then begin
> > if SigVal=1 then begin
> >  if  MP=1 then EXITLONG("MyBExit") at Market;
> >    ExitP=C;Profit=ExitP-EntryP;XSigName="MyBExit");
> >    {...Calculate and print whatever values you want in the report...}
> >   SigVal=0;
> >  end;