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

Novice EL Question



PureBytes Links

Trading Reference Links

Hi,I am trying to write the code so once I get a Signal from the crossover 
of the DMIPlus & DMIMinus I can reference the High/Low of the Entry Day 
depending on if the signal is for a long or short trade and then use that 
point as the stop loss.Heres what I have come up with, any feedback would be 
appreciated on were I am going wrong.TIA Mark

Input:Length(14);
Vars:ADXR14(0),DIPlus(0),DIMinus(0),EntryP(0);




ADXR14=ADXR(14);
DiPlus=DMIPlus(Length);
DiMinus=DMIMinus(Length);
EntryP=EntryPrice(1);




{STOP AND REVERSE SIGNALS}
If ADXR14>20 AND DiPlus>DiMinus Then
Buy at Market;
If ADXR14>20 AND DiPlus<DiMinus Then
Sell at Market;




{STOP LOSS SIGNALS}
If MarketPosition=1 Then
ExitLong("Long Stop")at Lowest(Low,EntryPrice)stop;
If MarketPosition=-1 Then
ExitShort("Short Stop")at Highest(High,EntryPrice)Limit;