help: fixed point in mql4

 
Can somebody help me with this problem I have? I need to make a fixed point in the price for my entry. Example:I want the prior 1 hour high be the entry price. So I put this in the EA:

iHigh(NULL,PERIOD_H1,1)

Let say that in the moment I active the EA is 14:00. So, the EA take the 13:00 high. The problem is that after an hour, at 15:00, the EA change the entry point to the 14:00 high.


What can I do for the EA always take the first point for entry without change to the next candle?

The use of the “iHigh” is an example. What I need is a function for let the indicate point in the EA be fixed, whatever is the strategy used. Can somebody help me? Somebody know how to do that?


Thanks a lot in advanced.
Trader201
 

Try something like

static bool PotentialTradeSetupSpotted = false;
static double PotentialTradeEntryPrice;

if(SetupConditionsMet())
{
   PotentialTradeSetupSpotted = true;
   PotentialTradeEnytryPrice = iHigh(NULL,PERIOD_H1,1);
}
...
if(SetupConditionsDied())
{
   PotentialTradeSetupSpotted = false;
}
...
if(PotentialTradeSetupSpotted && TradeTriggerConditionMet())
{
   OpenTradeWithPrice(PotentialTradeEntryPrice);
}

I've just typed this on-the-fly but I hope that it gives you some ideas on preserving future entry price between trade setup and actual trigger

 

Hello brewmanz. I´m sorry for write after this time. Thanks a lot for your help. I will try with this.

trader201



brewmanz:

Try something like

I've just typed this on-the-fly but I hope that it gives you some ideas on preserving future entry price between trade setup and actual triggers