Stock Portfolio Organizer

The ultimate porfolio management solution.

Shares, Margin, CFD's, Futures and Forex
EOD and Realtime
Dividends and Trust Distributions
And Much More ....
For Portfolio Manager Click Here

WiseTrader Toolbox

#1 Selling Amibroker Plugin featuring:

Advanced Adaptive Indicators
Advanced Pattern Exploration
Neural Networks
And Much More ....
Find Out More Here

Maual Trading Control for NEST/NOW for Amibroker (AFL)

Rating:
4 / 5 (Votes 8)
Tags:
amibroker

Maual Trading Control for NEST/NOW

Now we have afl available for automating the trading from NEST/NOW from a strategy using Nest Plus Plugin.

But if you want to manually take decision, what is the solution?
Looking the chart and placing a manual Buy Or Sell will take few time to place the order. By the time the trend may disappear.

This afl will provide you a control for generating Buy and Sell Signals from clicking the buttons in the chart.

Features

  1. You can predefine your quantity of Buy/Sell in the parameters
  2. You Can Enter your Client ID in the Parameters
  3. You can select the Buy/Sell Price from Ask price, Bid price or LTP.
  4. Option for Enabling Actual Trading (If Disabled, No Signals will go to NOW/NEST, But chart will generate signals.) This can be used for testing.
  5. Selecting the Buy/Sell as Intraday or Delivery.

Requirements.

  1. For Buy/Sell Price selection, use Aux1 and Aux2 for importing the Ask Bid Prices.
  2. Symbol in the Amibroker should be the same as present in the NEST/NOW.
  3. Active Nest Plus API Subscription is required (Contact Nest Plus for Details)

Usage

  1. Copy The Afl to Custom Afl folder of amibroker.
  2. Drag and drop the afl to an intraday chart blank chart.
  3. Enable Controls and Auto Trading Options.
  4. Set Lot Qty and Purchase Type.
  5. Type the Client ID.
  6. Press Buy Or Sell when you decided.
    (Decisions should be based on your trading strategy. This Afl will not generate any Buy/Sell Signals automatically)

[Suggest Features For Improvement]
[NEST, NOW, Amibroker are registered products of the Respective Companies]

Screenshots

Indicator / Formula

Copy & Paste Friendly
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
Title = " ";
 
_SECTION_BEGIN("MaualTradingInt1V00 ");
 
X2 = Param("Button X Offset", 0, 0, 2000, 100);
Y2 = Param("Button Y Offset", 0, 0, 2000, 100);
X1 = Param("Button Size", 100, 100, 300, 50);
 
EnableRealTimeControl = ParamList("Enable Controls", "No|Yes", 0);
EnableAutoTrade = ParamList("Enable Autotrade", "No|Yes", 0);
BuyPriceSelection = ParamList("Buy Price", "Bid Price|Ask Price|LTP", 0);
SellPriceSelection = ParamList("Sell Price", "Ask Price|Bid Price|LTP", 0);
ProductType = ParamList("Product Type", "MIS|NRML", 0);
OrderType = ParamList("Order Type", "LIMIT|MARKET", 0);
ClientIdValue = ParamStr("Client Id", "CLIENTID");
LotQuantity = Param("Lot Quantity", 1000, 50, 100000, 10);  // Default Trade Qty.
 
//firstflag=0;
if(StaticVarGetText("firstflag")=="")
{
    StaticVarSet("OrderNo", 0);
     
    StaticVarSet("LTPSave", 0);
    StaticVarSet("LTQSave", 0);
    StaticVarSet("VolumeTemp", 0);
    StaticVarSet("AskSave", 0);
    StaticVarSet("BidSave", 0);
     
    StaticVarSet("LastLTPColor", colorGrey40);
    StaticVarSet("LastLTQColor", colorGrey40);
    StaticVarSet("LastAskColor", colorGrey40);
    StaticVarSet("LastBidColor", colorGrey40);
     
    StaticVarSetText ("firstflag","0");
}
 
if(StaticVarGetText("firstflag"+Name())=="")
{
    StaticVarSet(("Buy_Price" + Name()), 0);
    StaticVarSet(("Buy_Qty" + Name()), 0);
    StaticVarSet(("Sell_Price" + Name()), 0);
    StaticVarSet(("Sell_Qty" + Name()), 0);
    StaticVarSet(("AvgBuy_Price" + Name()), 0);
    StaticVarSet(("NetBuy_Qty" + Name()), 0);
    StaticVarSet(("AvgSell_Price" + Name()), 0);
    StaticVarSet(("NetSell_Qty" + Name()), 0);
     
    StaticVarSetText("firstflag"+Name(), "0");
}
 
 
 
if(EnableAutoTrade == "Yes" && EnableRealTimeControl == "Yes")
{
    if(StaticVarGetText("firstflagforNest")=="")
    {
        nestplus = Null;
        if(IsNull(nestplus))
        {
            nestplus = CreateStaticObject("Nest.PlusApi");
            nestplus.SetObjectName("RKRAutoTrade");
        }
        StaticVarSetText ("firstflagforNest","0");
    }
     
}
 
TempBuyPrice = StaticVarGet(("Buy_Price" + Name()));
TempSellPrice = StaticVarGet(("Sell_Price" + Name()));
TempBuyQty = StaticVarGet(("Buy_Qty" + Name()));
TempSellQty = StaticVarGet(("Sell_Qty" + Name()));
 
LTPTemp = StaticVarGet("LTPSave");
LTQTemp = StaticVarGet("LTQSave");
VolumeTemp = StaticVarGet("VolumeTemp");
AskTemp = StaticVarGet("AskSave");
BidTemp = StaticVarGet("BidSave");
 
LTPLastTemp = LastValue(C);
VolumeLastTemp = LastValue(Volume);
 
LTQLastTemp = (VolumeLastTemp - VolumeTemp);
 
if(LTQLastTemp < 0)
{
    LTQLastTemp = LTQLastTemp * -1;
}
 
if(LTQLastTemp == 0)
{
    LTQLastTemp = LTQTemp;
}
 
 
AskLastTemp = LastValue(Aux1);
BidLastTemp = LastValue(Aux2);
 
LTPColor = StaticVarGet("LastLTPColor");
LTQColor = StaticVarGet("LastLTQColor");
AskColor = StaticVarGet("LastAskColor");
BidColor = StaticVarGet("LastBidColor");
 
 
if(LTPTemp > LTPLastTemp)
{
    LTPColor = colorRed;
}
else if(LTPTemp < LTPLastTemp)
{
    LTPColor = ColorGreen;
}
 
if(LTQTemp > LTQLastTemp)
{
    LTQColor = colorRed;
}
else if(LTQTemp < LTQLastTemp)
{
    LTQColor = ColorGreen;
}
 
if(AskTemp > AskLastTemp)
{
    AskColor = colorRed;
}
else if(AskTemp < AskLastTemp)
{
    AskColor = ColorGreen;
}
 
if(BidTemp > BidLastTemp)
{
    BidColor = colorRed;
}
else if(BidTemp < BidLastTemp)
{
    BidColor = ColorGreen;
}
 
StaticVarSet("LastLTPColor", LTPColor);
StaticVarSet("LastLTQColor", LTQColor);
StaticVarSet("LastAskColor", AskColor);
StaticVarSet("LastBidColor", BidColor);
 
StaticVarSet("LTPSave", LTPLastTemp);
StaticVarSet("LTQSave", LTQLastTemp);
StaticVarSet("VolumeTemp", VolumeLastTemp);
StaticVarSet("AskSave", AskLastTemp);
StaticVarSet("BidSave", BidLastTemp);
 
X0 = 20;
Y0 = 10;
 
procedure DrawData (Text, x1, y1, x2, y2, colorFrom, colorTo)
{
    GfxSetOverlayMode(0);
    GfxSelectFont("Verdana", 8.5, 700);
    GfxSetBkMode(1);
    GfxGradientRect(x1, y1, x2, y2, colorFrom, colorTo);
    GfxDrawText(Text, x1, y1, x2, y2, 32|1|4|16);
}
GfxSetTextColor(colorWhite);
 
 
 
NetBuyQtyDisplay = StaticVarGet(("NetBuy_Qty" + Name()));
if(NetBuyQtyDisplay == 0)
{
    BuyAvgPriceDisplay = 0;
}
else
{
    BuyAvgPriceDisplay = (StaticVarGet(("AvgBuy_Price" + Name())))/(NetBuyQtyDisplay/LotQuantity);
}
 
NetSellQtyDisplay = StaticVarGet(("NetSell_Qty" + Name()));
if(NetSellQtyDisplay == 0)
{
    SellAvgPriceDisplay = 0;
}
else
{
    SellAvgPriceDisplay = (StaticVarGet(("AvgSell_Price" + Name())))/(NetSellQtyDisplay/LotQuantity);
}
 
 
 
TempNetQuantity = NetBuyQtyDisplay - NetSellQtyDisplay;
TempNetValue = (SellAvgPriceDisplay * NetSellQtyDisplay) - (BuyAvgPriceDisplay * NetBuyQtyDisplay);
 
TempNetQuantityColor = colorGrey40;
TempNetValueColor = colorGrey40;
 
if(TempNetQuantity > 0)
{
    TempNetQuantityColor = colorGreen;
}
else if(TempNetQuantity < 0)
{
    TempNetQuantityColor = colorRed;
}
 
if(TempNetValue > 0)
{
    TempNetValueColor = colorGreen;
}
else if(TempNetValue < 0)
{
    TempNetValueColor = colorRed;
}
 
DrawData (Name(), X0, Y0, X0+300, Y0+20, colorGrey40, colorGrey40);
DrawData (Date(), X0+305, Y0, X0+470, Y0+20, colorGrey40, colorGrey40);
DrawData ("Open : " + Open, X0+475, Y0, X0+625, Y0+20, colorGrey40, colorGrey40);
DrawData ("Close : " + Close, X0+630, Y0, X0+780, Y0+20, colorGrey40, colorGrey40);
DrawData ("High : " + High, X0+785, Y0, X0+935, Y0+20, colorGrey40, colorGrey40);
DrawData ("Low : " + Low, X0+940, Y0, X0+1090, Y0+20, colorGrey40, colorGrey40);
DrawData ("Volume : " + NumToStr(Volume,1,0), X0+1095, Y0, X0+1300, Y0+20, colorGrey40, colorGrey40);
DrawData ("% Change : " + NumToStr( (((C-O)*100)/O), 1.2, True), X0+1305, Y0, X0+1450, Y0+20, colorGrey40, colorGrey40);
 
if(EnableRealTimeControl == "Yes")
{
    DrawData ("Buy Price : " + TempBuyPrice, X0, Y0+25, X0+150, Y0+45, colorGrey40, colorGrey40);
    DrawData ("Buy Qty : " + TempBuyQty, X0+155 , Y0+25, X0+305, Y0+45, colorGrey40, colorGrey40);
    DrawData ("Sell Price : " + TempSellPrice, X0+310, Y0+25, X0+460, Y0+45, colorGrey40, colorGrey40);
    DrawData ("Sell Qty : " + TempSellQty, X0+465, Y0+25, X0+615, Y0+45, colorGrey40, colorGrey40);
 
    DrawData ("BuyAvgPrice : " + BuyAvgPriceDisplay, X0+620, Y0+25, X0+770, Y0+45, colorGrey40, colorGrey40);
    DrawData ("NetBuyQty : " + NetBuyQtyDisplay, X0+775 , Y0+25, X0+925, Y0+45, colorGrey40, colorGrey40);
    DrawData ("SellAvgPrice : " + SellAvgPriceDisplay, X0+930, Y0+25, X0+1080, Y0+45, colorGrey40, colorGrey40);
    DrawData ("NetSellQty : " + NetSellQtyDisplay, X0+1085, Y0+25, X0+1235, Y0+45, colorGrey40, colorGrey40);
     
    TempNestOredrNo = ClientIdValue + NumToStr(Now(3),1,0) + "00" + StaticVarGet("OrderNo");
     
    DrawData ("NetQty : " + TempNetQuantity, X0+520, Y0+50, X0+670, Y0+70, TempNetQuantityColor, TempNetQuantityColor);
    DrawData ("NetValue : " + TempNetValue, X0+675, Y0+50, X0+900, Y0+70, TempNetValueColor, TempNetValueColor);
    DrawData ("Order No : " + TempNestOredrNo, X0+905, Y0+50, X0+1150, Y0+70, colorGrey40, colorGrey40);
     
    DrawData ("LTP : " + LTPLastTemp, X0, Y0+50, X0+125, Y0+70, LTPColor, LTPColor);
    DrawData ("LTQ : " + NumToStr(LTQLastTemp,1,0), X0+130, Y0+50, X0+255, Y0+70, LTQColor, LTQColor);
    DrawData ("Bid : " + BidLastTemp, X0+260, Y0+50, X0+385, Y0+70, AskColor, AskColor);
    DrawData ("Ask : " + AskLastTemp, X0+390, Y0+50, X0+515, Y0+70, BidColor, BidColor);
}
 
X0 = X2 + 20;
Y0 = Y2 + 100;
 
 
LBClick = GetCursorMouseButtons() == 9; // Click
MouseX  = Nz(GetCursorXPosition(1));        //
MouseY  = Nz(GetCursorYPosition(1));        //
 
procedure DrawBut (Text, x1, y1, x2, y2, colorFrom, colorTo)
{
    GfxSetOverlayMode(0);
    GfxSelectFont("Verdana", 9, 700);
    GfxSetBkMode(1);
    GfxGradientRect(x1, y1, x2, y2, colorFrom, colorTo);
    GfxDrawText(Text, x1, y1, x2, y2, 32|1|4|16);
}
GfxSetTextColor(colorWhite);
 
if(EnableRealTimeControl == "Yes")
{
 
    DrawBut ("Buy", X0, Y0, X0+X1, Y0+30, colorGreen, colorGreen);
    CursorInBuyButton = MouseX >= X0 AND MouseX <= X0+X1 AND MouseY >= Y0 AND MouseY <= Y0+30;
    BuyButtonClick = CursorInBuyButton AND LBClick;
    if (BuyButtonClick)
    {
        DrawBut("Buy", X0+X1+10, Y0, X0+X1+75, Y0+30,  colorGrey40, colorGrey40);
        TempBuy = LastValue(DateTime());
        StaticVarSet(("BuyIndex" + Name()),  TempBuy);
         
        TempBuyLastQty = StaticVarGet(("NetBuy_Qty" + Name()));
        TempNetBuyQty = (TempBuyLastQty + LotQuantity);
         
        TempBuyLastPrice = StaticVarGet(("AvgBuy_Price" + Name()));
         
        if(BuyPriceSelection == "Bid Price")
        {
            BuyPriceValue = BidLastTemp;
        }
        else if(BuyPriceSelection == "Ask Price")
        {
            BuyPriceValue = AskLastTemp;
        }
        else
        {
            BuyPriceValue = LTPLastTemp;
        }
         
        if(TempBuyLastQty == 0)
        {
            TempAvgBuyPrice = BuyPriceValue;
        }
        else
        {
            TempAvgBuyPrice = (BuyPriceValue + TempBuyLastPrice);
        }
         
        StaticVarSet(("Buy_Price" + Name()),  BuyPriceValue);
        StaticVarSet(("Buy_Qty" + Name()),  LotQuantity);
         
        StaticVarSet(("AvgBuy_Price" + Name()),  TempAvgBuyPrice);
        StaticVarSet(("NetBuy_Qty" + Name()),  TempNetBuyQty);
         
        if(EnableAutoTrade == "Yes" && EnableRealTimeControl == "Yes")
        {
            LastOrderNo = StaticVarGet("OrderNo");
            LastOrderNo++;
            StaticVarSet("OrderNo", LastOrderNo);
            TempOrderNo = ClientIdValue + NumToStr(Now(3),1,0) + "00" + LastOrderNo;
            TempName = Name() + "-EQ";
            nestplus.PlaceOrder("BUY", TempOrderNo, "NSE", TempName, "DAY", OrderType, LotQuantity, BuyPriceValue, 0.0, 0, ProductType, ClientIdValue);
        }  
    }
 
    DrawBut ("Sell", X0, Y0+40, X0+X1, Y0+70, colorRed, colorRed);
    CursorInSellButton = MouseX >= X0 AND MouseX <= X0+X1 AND MouseY >= Y0+40 AND MouseY <= Y0+70;
    SellButtonClick = CursorInSellButton AND LBClick;
    if (SellButtonClick)
    {
        DrawBut("Sell", X0+X1+10, Y0, X0+X1+75, Y0+30,  colorGrey40, colorGrey40);
        TempSell = LastValue(DateTime());
        StaticVarSet(("SellIndex" + Name()),  TempSell);
         
        TempSellLastQty = StaticVarGet(("NetSell_Qty" + Name()));
        TempNetSellQty = (TempSellLastQty + LotQuantity);
         
        TempSellLastPrice = StaticVarGet(("AvgSell_Price" + Name()));
         
        if(SellPriceSelection == "Ask Price")
        {
            SellPriceValue = AskLastTemp;
        }
        else if(SellPriceSelection == "Bid Price")
        {
            SellPriceValue = BidLastTemp;
        }
        else
        {
            SellPriceValue = LTPLastTemp;
        }
         
        if(TempSellLastQty == 0)
        {
            TempAvgSellPrice = SellPriceValue;
        }
        else
        {
            TempAvgSellPrice = (SellPriceValue + TempSellLastPrice);
        }
         
        StaticVarSet(("Sell_Price" + Name()),  SellPriceValue);
        StaticVarSet(("Sell_Qty" + Name()),  LotQuantity);
         
        StaticVarSet(("AvgSell_Price" + Name()),  TempAvgSellPrice);   
        StaticVarSet(("NetSell_Qty" + Name()),  TempNetSellQty);
         
        if(EnableAutoTrade == "Yes" && EnableRealTimeControl == "Yes")
        {
            LastOrderNo = StaticVarGet("OrderNo");
            LastOrderNo++;
            StaticVarSet("OrderNo", LastOrderNo);
            TempOrderNo = ClientIdValue + NumToStr(Now(3),1,0) + "00" + LastOrderNo;
            TempName = Name() + "-EQ";
            nestplus.PlaceOrder("SELL", TempOrderNo, "NSE", TempName, "DAY", OrderType, LotQuantity, SellPriceValue, 0.0, 0, ProductType, ClientIdValue);
        }  
    }
 
    DrawBut ("Clear Data", X0, Y0+80, X0+X1, Y0+110, colorGrey40, colorGrey40);
    CursorInClearButton = MouseX >= X0 AND MouseX <= X0+X1 AND MouseY >= Y0+80 AND MouseY <= Y0+110;
    ClearButtonClick = CursorInClearButton AND LBClick;
    if (ClearButtonClick)
    {
        DrawBut("Clear", X0+X1+10, Y0, X0+X1+75, Y0+30,  colorGrey40, colorGrey40);
        StaticVarRemove(("BuyIndex" + Name()));
        StaticVarRemove(("SellIndex" + Name()));
        StaticVarSetText("firstflag"+Name(), "");
    }
 
    BuyTempData = StaticVarGet(("BuyIndex" + Name()));
    SellTempData = StaticVarGet(("SellIndex" + Name()));
 
    Buy = IIF(DateTime() == BuyTempData, 1, 0);
    Sell = IIF(DateTime() == SellTempData, 1, 0);
 
    Buyshape = Buy * shapeUpArrow;
    SellShape = Sell * shapeDownArrow;
    PlotShapes( Buyshape, colorBrightGreen, 0, Low );
    PlotShapes( SellShape, colorRed, 0, High );
    GraphXSpace = 5;
}
 
_SECTION_END();
 
_SECTION_BEGIN("Price");
SetChartOptions(0,chartShowArrows|chartShowDates);
//_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} \nOpen : %g, Close : %g (%.1f%%) \nLow : %g, High : %g (%.1f%%) \nVolume : " +WriteVal( V, 1.0 ) +" {{VALUES}}", O, C,(((C-O)*100)/O), L, H, (((H-L)*100)/L) ));
Plot( C, "Close", ParamColor("Color", colorDefault ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() );
_SECTION_END();
 
_SECTION_BEGIN("MA");
P = ParamField("Price field",-1);
Periods = Param("Periods", 10, 2, 200, 1 );
Plot( MA( P, Periods ), /*_DEFAULT_NAME()*/ "", ParamColor( "Color", colorGreen ), ParamStyle("Style", styleLine | styleNoLabel ) | styleNoRescale );
_SECTION_END();
 
_SECTION_BEGIN("EMA");
P = ParamField("Price field",-1);
Periods = Param("Periods", 30, 2, 300, 1, 10 );
Plot( EMA( P, Periods ), /*_DEFAULT_NAME()*/ "", ParamColor( "Color", colorOrange ), ParamStyle("Style", styleLine | styleNoLabel) | styleNoRescale );
_SECTION_END();
 
_SECTION_BEGIN("Long MA");
P = ParamField("Price field",-1);
Periods = Param("Periods", 45, 2, 400, 1 );
Plot( MA( P, Periods ), /*_DEFAULT_NAME()*/ "", ParamColor( "Color", colorYellow ), ParamStyle("Style", styleLine | styleNoLabel ) | styleNoRescale );
_SECTION_END();
 
_SECTION_BEGIN("BBands");
P = ParamField("Price field",-1);
Periods = Param("Periods", 15, 2, 100, 1 );
Width = Param("Width", 2, 0, 10, 0.05 );
Color = ParamColor("Color", colorLightGrey );
Color = ColorBlend( Color,  GetChartBkColor(), 0.5 );
Style = ParamStyle("Style", styleLine | styleNoLabel ) | styleNoRescale;;
Plot( bbt = BBandTop( P, Periods, Width ), /*"BBTop" + _PARAM_VALUES()*/ "", Color, Style );
Plot( bbb = BBandBot( P, Periods, Width ), /*"BBBot" + _PARAM_VALUES()*/ "", Color, Style );
PlotOHLC( bbt, bbt, bbb, bbb, "", ColorBlend( Color, GetChartBkColor(), 0.7 ), styleNoLabel | styleCloud | styleNoRescale, Null, Null, Null, -1 );
_SECTION_END();
 
_SECTION_BEGIN("Volume");
Color = ParamColor("Color", ColorRGB( 128, 128, 192 ) );
Plot( Volume, /*_DEFAULT_NAME()*/"", ColorBlend( Color, GetChartBkColor(), 0.2  ), styleNoTitle | ParamStyle( "Style", styleHistogram | styleOwnScale | styleThick | styleNoLabel, maskHistogram  ), 2 );
_SECTION_END();

15 comments

1. indiainfo2008

thanks for sharing the code
but it has errors
StaticVarSet(“OrderNo”, 0, 1);
StaticVarSet(“LTPSave”, LTPLastTemp, 1);

error is too many arguments I am using amibroker 5.6
from the help of amibroker user guide
StaticVarSet( ’’varname’’, value ) RETURNS NUMBER
Sets the value of static variable. Returns 1 on success 0 on failure.

if you correct this or give a solution it will be helpful
thanks

2. ranjicgnr

I am using Amibroker 5.9 and the code is not giving any error. If possible, update the Amibroker to the latest version.

Else try deleting the last parameter on the StaticVarSet statement. You should do this for all the StaticVarSet function.

Eg:
StaticVarSet(“OrderNo”, 0, 1); → StaticVarSet(“OrderNo”, 0);

3. aroonsankar

Thanks for sharing the code, ranjicgnr. Is it possible to automate the trades fully, adding this code to my existing afl which gives Buy/Sell? If yes, what r the changes to be made to your afl?

4. ranjicgnr

Hai aroonsankar.

Yes. You can fully automate the trades. You have to add your code in the beginning of my code. Then replace the button check condition with your yor Buy/Sell condition check. ie [if (BuyButtonClick)& if (SellButtonClick) ]

I will post a new afl with manual and auto buy options. It may take some time.

5. aroonsankar

Thanks Ranji for your prompt reply. Your Afl was much awaited one by many traders. Waiting more build-up.

6. srini41

Dear ranji sir,

when you post kindly post afl compatible with 5.7 version as this buy botton not working in 5.7 version, throwing some error.

Kindly consider this when you post the new afl

Thank you and regards
Srini

7. ranjicgnr

Dear Srini,

Thanks for testing afl. But i have tested with Amibroker 5.7 version also. The buttons are working for me. Check are you selected Yes for Enable AutoTrade. If you enabled this, you should need a NEST PLUS API subscription from your broker/omnisys and the NEST/NOW trader must be opened and logged in. Else this will give an error. Error may be “COM object handle is null”.

8. ranjicgnr

Use “AutoTrade Control For NEST/NOW” instead of this. That is an updated version.

9. srini41

dear ranji sir,

I need your mail id to contact you or your no for my strategy framework to associate with company.

10. ranjicgnr

My Mail ID is ranjicgnr@gmail.com

11. amifan2014

dear ranjicgnr,
i’m getting an error ‘COM object variable is not initialized or has invalid type(valid COM object handle is required)’. I have enabled NEST PLUS API subscription.Is that another Nest Plus Api DEALER required to run this afl?

12. pradeep.try

Dear Ranjith

I can’t able to plungin your Afl. How to plugin?

13. ranjicgnr

For detailed help, mail me.
ranjicgnr@gmail.com

14. SRDOIJODE

Hi,
Anyone got this working for NFO kindly post the modified code. Keep getting error ‘COM object variable is not initialized or has invalid type(valid COM object handle is required)’. Using Trial ami 5.9, and GDFl datafeed , Tried reinstallation of ami, as suggested by someone else in the forum with no luck. Strangely the GDFL plugin works fine.
Thanks in advance

15. baloocci

Both the Manual and Auto afl are not working for me
for manual iam getting the below error
COM object variable is not initialized or has invalid type(valid COM object handle is required)
For Auto i am getting below error when i try to enable controls
Ln:541,Col:46
Error51.
Array subscript has null value. Subscript must be within 0…BarCount-1 range.

Leave Comment

Please login here to leave a comment.

Back